Documentation ¶
Index ¶
- func AuthenticateWithASAP(asap ASAP, audience, subject string) restclient.RequestMutation
- func DecodePKCS8PrivateKey(privateKey string) (crypto.PrivateKey, error)
- func EncodePKCS8PrivateKey(privateKey crypto.PrivateKey, privateKeyID string) (string, error)
- type ASAP
- type ASAPClientConfig
- func (a *ASAPClientConfig) GenerateToken(audience string, subject string) ([]byte, error)
- func (a *ASAPClientConfig) GenerateTokenWithClaims(audience string, subject string, claims jws.Claims) ([]byte, error)
- func (a *ASAPClientConfig) KeyID() string
- func (a *ASAPClientConfig) KeyIssuer() string
- func (a *ASAPClientConfig) PublicKey() (crypto.PublicKey, error)
- type MirroredPublicKeyProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticateWithASAP ¶
func AuthenticateWithASAP(asap ASAP, audience, subject string) restclient.RequestMutation
SSAM API Documentation - https://ssam.office.atlassian.com/api/
func DecodePKCS8PrivateKey ¶
func DecodePKCS8PrivateKey(privateKey string) (crypto.PrivateKey, error)
func EncodePKCS8PrivateKey ¶
func EncodePKCS8PrivateKey(privateKey crypto.PrivateKey, privateKeyID string) (string, error)
Types ¶
type ASAP ¶
type ASAP interface { GenerateToken(audience string, subject string) ([]byte, error) GenerateTokenWithClaims(audience string, subject string, claims jws.Claims) ([]byte, error) KeyID() string KeyIssuer() string }
type ASAPClientConfig ¶
type ASAPClientConfig struct { PrivateKey crypto.PrivateKey PrivateKeyID string `validate:"required"` Issuer string `validate:"required"` }
func NewASAPClientConfig ¶
func NewASAPClientConfig(keyID, issuer string, key crypto.PrivateKey) (*ASAPClientConfig, error)
func NewASAPClientConfigFromEncodedKey ¶
func NewASAPClientConfigFromEncodedKey(keyID, issuer, encodedPrivateKey string) (*ASAPClientConfig, error)
NewASAPClientConfigFromEncodedKey is used when you have an encoded PKCS8 private key, encoded with dataurl e.g. `dataurl.New(marshalledPrivateKey, "application/pkcs8", "kid", keyID)`
func NewASAPClientConfigFromKubernetesSecret ¶
func NewASAPClientConfigFromKubernetesSecret(secret *core_v1.Secret) (*ASAPClientConfig, error)
func (*ASAPClientConfig) GenerateToken ¶
func (a *ASAPClientConfig) GenerateToken(audience string, subject string) ([]byte, error)
GenerateToken creates a token with an audience claim and a subject claim. If subject is not provided, it will not be part of the claim.
func (*ASAPClientConfig) GenerateTokenWithClaims ¶
func (*ASAPClientConfig) KeyID ¶
func (a *ASAPClientConfig) KeyID() string
func (*ASAPClientConfig) KeyIssuer ¶
func (a *ASAPClientConfig) KeyIssuer() string
type MirroredPublicKeyProvider ¶
type MirroredPublicKeyProvider struct {
// contains filtered or unexported fields
}
func NewMirroredPublicKeyProvider ¶
func NewMirroredPublicKeyProvider(logger *zap.Logger, primary, fallback keyprovider.PublicKeyProvider) *MirroredPublicKeyProvider
func (*MirroredPublicKeyProvider) GetPublicKey ¶
func (m *MirroredPublicKeyProvider) GetPublicKey(keyID string) (crypto.PublicKey, error)
Click to show internal directories.
Click to hide internal directories.