Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package hashvault
import "fiskerinc.com/modules/common"
type VaultMock struct {
}
func (vm VaultMock) CreateCertificate(cn string, certificateType string, isEU bool) (*common.Certificate, error) {
if isEU {
return &common.Certificate{Type: certificateType, CommonName: cn, Valid: true, PublicKey: "testEU"}, nil
}
return &common.Certificate{Type: certificateType, CommonName: cn, Valid: true, PublicKey: "test"}, nil
}
func (vm VaultMock) CreatePKICertificate(cn string) (*common.Certificate, error) {
return &common.Certificate{Type: "rsa", CommonName: cn, Valid: true, PublicKey: "test"}, nil
}
func (vm VaultMock) RevokeCertificate(serial string, certType string) (*common.Certificate, error) {
return &common.Certificate{SerialNumber: serial, Valid: false}, nil
}
func (vm VaultMock) RenewCertificate(commonName string, privateKey string, certType string) (*common.Certificate, error) {
return &common.Certificate{PublicKey: "test", CommonName: commonName, Valid: true, Type: certType}, nil
}