Documentation ¶
Overview ¶
Package service contains services used by code here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertificateGenerator ¶
type CertificateGenerator struct {
// contains filtered or unexported fields
}
CertificateGenerator is used to generate certificates.
func NewCertificateGenerator ¶
func NewCertificateGenerator(lifeTime time.Duration) *CertificateGenerator
NewCertificateGenerator is the preferred way to instantiate a certificate generator.
func (*CertificateGenerator) CreateChild ¶
func (c *CertificateGenerator) CreateChild(parent *x509.Certificate, key interface{}) (*x509.Certificate, error)
CreateChild - creates a child certificate with given key and parent certificate.
func (*CertificateGenerator) CreateParent ¶
func (c *CertificateGenerator) CreateParent() (*x509.Certificate, error)
CreateParent generates a X.509 parent/root certificate for use in authorization servers.
type ClientRepo ¶ added in v1.1.1
type ClientRepo struct {
// contains filtered or unexported fields
}
ClientRepo is a repo for storing registred clients and generating tokens for clients.
func NewClientRepo ¶ added in v1.1.1
func NewClientRepo() *ClientRepo
NewClientRepo is the preferred way to instantiate a client repo.
func (*ClientRepo) GenerateToken ¶ added in v1.1.1
func (c *ClientRepo) GenerateToken(request jwtmock.ClientTokenRequest, key *jwtmock.SigningKey) (*jwtmock.ClientTokenResponse, error)
GenerateToken generates a token response from the given client request
func (*ClientRepo) Register ¶ added in v1.1.1
func (c *ClientRepo) Register(registration jwtmock.ClientRegistration) error
Register registers a new client and returns any errors
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
KeyStore is used to keep state about current JWKS and signing key.
func NewKeyStore ¶
NewKeyStore is the preferred way to instantiate a key store.
func (*KeyStore) GenerateNew ¶
GenerateNew generates a new pair of JWKS and signing key.
func (*KeyStore) GetSigningKey ¶
func (k *KeyStore) GetSigningKey() *jwtmock.SigningKey
GetSigningKey returns the currently stored signing key.
type RSAKeyGenerator ¶
type RSAKeyGenerator struct{}
RSAKeyGenerator generates key IDs and keys.
func NewRSAKeyGenerator ¶
func NewRSAKeyGenerator() *RSAKeyGenerator
NewRSAKeyGenerator is the preferred way to create a RSA key generator.
func (*RSAKeyGenerator) GenerateKey ¶
func (k *RSAKeyGenerator) GenerateKey(length int) (*jwtmock.SigningKey, error)
GenerateKey generates a RSA signing key.