Documentation ¶
Index ¶
- Variables
- type AuthService
- type AuthServiceImpl
- type CertInfo
- type CertificateService
- type CertificateServiceImpl
- func (c *CertificateServiceImpl) CreateCACert(ctx context.Context, request *contracts.CreateCARequest, userID string, ...) ([]byte, error)
- func (c *CertificateServiceImpl) CreateCert(ctx context.Context, caID string, request *contracts.CreateCertificateRequest, ...) (*contracts.CertificateLightResponse, error)
- func (c *CertificateServiceImpl) DeleteCertForUser(ctx context.Context, id string, userID string) error
- func (c *CertificateServiceImpl) GetCert(ctx context.Context, id string) (*contracts.CertificateResponse, error)
- func (c *CertificateServiceImpl) GetCertAsPEMForUser(ctx context.Context, id string, userID string) (string, error)
- func (c *CertificateServiceImpl) GetCertsByParentCAForUser(ctx context.Context, parentCA string, userID string) ([]*contracts.CertificateLightResponse, error)
- func (c *CertificateServiceImpl) GetUserCerts(ctx context.Context, userId string, certTypes []CertificateType) ([]*contracts.CertificateLightResponse, error)
- type CertificateType
- type KeyService
- type KeyServiceImpl
- func (k *KeyServiceImpl) CreateKey(ctx context.Context, userId string, name string, ...) (*contracts.KeyLightResponse, error)
- func (k *KeyServiceImpl) GetDecryptedKeyForUser(ctx context.Context, keyId string, userId string, password string) (PrivateKey, error)
- func (k *KeyServiceImpl) GetKeysForUser(ctx context.Context, userId string) ([]*contracts.KeyLightResponse, error)
- type OAuthClaims
- type PrivateKey
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCertUnautorized = errors.New("user does not have access to this certificate")
Functions ¶
This section is empty.
Types ¶
type AuthService ¶
type AuthService interface { GetUserForRequest(ctx context.Context, r *http.Request) (*daos.User, error) ValidateOAuthToken( ctx context.Context, provider string, accessToken string, ) (*daos.User, error) }
func NewAuthService ¶
func NewAuthService(userRepository repositories.UserRepository) AuthService
type AuthServiceImpl ¶
type AuthServiceImpl struct {
// contains filtered or unexported fields
}
func (*AuthServiceImpl) GetUserForRequest ¶
func (*AuthServiceImpl) ValidateOAuthToken ¶
type CertInfo ¶
type CertInfo struct { Cert *x509.Certificate PrivateKey *rsa.PrivateKey }
type CertificateService ¶
type CertificateService interface { DeleteCertForUser(ctx context.Context, id string, userID string) error GetCert(ctx context.Context, id string) (*contracts.CertificateResponse, error) GetCertAsPEMForUser(ctx context.Context, id string, userID string) (string, error) GetUserCerts( ctx context.Context, userId string, certTypes []CertificateType, ) ([]*contracts.CertificateLightResponse, error) CreateCACert( ctx context.Context, request *contracts.CreateCARequest, userID string, certType CertificateType, ) ( []byte, error, ) CreateCert( ctx context.Context, caID string, request *contracts.CreateCertificateRequest, userID string, ) (*contracts.CertificateLightResponse, error) GetCertsByParentCAForUser( ctx context.Context, parentCA string, userID string, ) ([]*contracts.CertificateLightResponse, error) }
type CertificateServiceImpl ¶
type CertificateServiceImpl struct {
// contains filtered or unexported fields
}
func NewCertificateServiceImpl ¶
func NewCertificateServiceImpl( certRepository repositories.CertRepository, keyRepository repositories.KeyRepository, keyService KeyService, ) *CertificateServiceImpl
func (*CertificateServiceImpl) CreateCACert ¶
func (c *CertificateServiceImpl) CreateCACert( ctx context.Context, request *contracts.CreateCARequest, userID string, certificateType CertificateType, ) ([]byte, error)
func (*CertificateServiceImpl) CreateCert ¶
func (c *CertificateServiceImpl) CreateCert( ctx context.Context, caID string, request *contracts.CreateCertificateRequest, userID string, ) (*contracts.CertificateLightResponse, error)
func (*CertificateServiceImpl) DeleteCertForUser ¶
func (*CertificateServiceImpl) GetCert ¶
func (c *CertificateServiceImpl) GetCert( ctx context.Context, id string, ) (*contracts.CertificateResponse, error)
func (*CertificateServiceImpl) GetCertAsPEMForUser ¶
func (*CertificateServiceImpl) GetCertsByParentCAForUser ¶
func (c *CertificateServiceImpl) GetCertsByParentCAForUser( ctx context.Context, parentCA string, userID string, ) ([]*contracts.CertificateLightResponse, error)
func (*CertificateServiceImpl) GetUserCerts ¶
func (c *CertificateServiceImpl) GetUserCerts( ctx context.Context, userId string, certTypes []CertificateType, ) ( []*contracts.CertificateLightResponse, error, )
type CertificateType ¶
type CertificateType string
const ( CertTypeRootCA CertificateType = "root_ca" CertTypeIntermediateCA CertificateType = "intermediate_ca" CertTypeCertificate CertificateType = "certificate" )
func (CertificateType) String ¶
func (ct CertificateType) String() string
type KeyService ¶
type KeyService interface { CreateKey( ctx context.Context, userId string, name string, algorithm contracts.KeyAlgorithm, password string, ) ( *contracts.KeyLightResponse, error, ) GetDecryptedKeyForUser( ctx context.Context, keyId string, userId string, password string, ) (PrivateKey, error) GetKeysForUser( ctx context.Context, userId string, ) ([]*contracts.KeyLightResponse, error) }
type KeyServiceImpl ¶
type KeyServiceImpl struct {
// contains filtered or unexported fields
}
func NewKeyServiceImpl ¶
func NewKeyServiceImpl(keyRepository repositories.KeyRepository) *KeyServiceImpl
func (*KeyServiceImpl) CreateKey ¶
func (k *KeyServiceImpl) CreateKey( ctx context.Context, userId string, name string, algorithm contracts.KeyAlgorithm, password string, ) (*contracts.KeyLightResponse, error)
func (*KeyServiceImpl) GetDecryptedKeyForUser ¶
func (k *KeyServiceImpl) GetDecryptedKeyForUser( ctx context.Context, keyId string, userId string, password string, ) (PrivateKey, error)
func (*KeyServiceImpl) GetKeysForUser ¶
func (k *KeyServiceImpl) GetKeysForUser( ctx context.Context, userId string, ) ([]*contracts.KeyLightResponse, error)
type OAuthClaims ¶
type PrivateKey ¶
type PrivateKey interface { Public() crypto.PublicKey Equal(x crypto.PrivateKey) bool }
PrivateKey is a custom interface - all crypto packages implement this interface, but crypto.PrivateKey type is any for backwards compat
Click to show internal directories.
Click to hide internal directories.