Documentation
¶
Index ¶
- Constants
- type JSONKey
- type JWKS
- func (j JWKS) DoGetJWKS(_ context.Context) Manager
- func (j JWKS) GetJWKSRSAKeys(awsRegion, poolID string) (map[string]string, error)
- func (j JWKS) JWKSGetKeyset(awsRegion, poolID string) (*JWKS, error)
- func (j JWKS) JWKSToRSA(jwks *JWKS) (map[string]string, error)
- func (j JWKS) JWKSToRSAJSONResponse(jwks *JWKS) ([]byte, error)
- func (j JWKS) JWKToRSAPublicKey(jwk JSONKey) (string, error)
- type Manager
Constants ¶
const ( RSAAlgorithm = "RSA" RSAExponentAQAB = "AQAB" RSAExponentAAEAAQ = "AAEAAQ" RSADefaultExponent = 65537 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONKey ¶
type JSONKey struct {
E string `json:"e"` // Exponent of the RSA public key.
Kid string `json:"kid"` // Key ID used to match a specific key.
Kty string `json:"kty"` // Key type (e.g., "RSA").
N string `json:"n"` // Modulus of the RSA public key.
}
JSONKey represents a single JSON Web Key (JWK) with RSA key parameters.
type JWKS ¶
type JWKS struct {
Keys []JSONKey `json:"keys"` // List of JSON Web Keys.
}
JWKS represents a JSON Web Key Set (JWKS) containing multiple JSONKey entries.
func (JWKS) GetJWKSRSAKeys ¶
GetJWKSRSAKeys retrieves the JWKS RSA keys which are consumed by the authorisation middleware on startup.
func (JWKS) JWKSGetKeyset ¶
JWKSGetKeyset primary package method which retrives the json web key set for cognito user pool
func (JWKS) JWKSToRSAJSONResponse ¶
JWKSToRSAJSONResponse method returns byte[] array for request response
type Manager ¶
type Manager interface {
// JWKSGetKeyset retrieves the JWKS for the specified AWS region and user pool ID.
JWKSGetKeyset(awsRegion, poolID string) (*JWKS, error)
// JWKSToRSAJSONResponse formats the JWKS as an RSA JSON response.
JWKSToRSAJSONResponse(jwks *JWKS) ([]byte, error)
}
Manager defines methods for managing JSON Web Key Sets (JWKS). It provides domain-specific methods to retrieve and format JWKS data and serves the purpose of maintaining explicit, domain-specific naming that aligns with the rest of the system.