Versions in this module Expand all Collapse all v0 v0.1.0 Apr 30, 2023 Changes in this version + var DefaultDescription = map[string]string + var ErrGInvalidClient = errors.New("invalid_client") + var ErrGInvalidContinuation = errors.New("invalid_continuation") + var ErrGInvalidFlag = errors.New("invalid_flag") + var ErrGInvalidInteraction = errors.New("invalid_interaction") + var ErrGInvalidRotation = errors.New("invalid_rotation") + var ErrGKRNotSupported = errors.New("key_rotation_not_supported") + var ErrGRequestDenied = errors.New("request_denied") + var ErrGTooFast = errors.New("too_fast") + var ErrGTooManyAttempts = errors.New("too_many_attempts") + var ErrGUnknownInteraction = errors.New("unknown_interaction") + var ErrGUnknownUser = errors.New("unknown_user") + var ErrGUserDenied = errors.New("user_denied") + var ErrInvalidAFormat = errors.New("invalid assertion format") + var ErrInvalidAccessRight = errors.New("invalid access right") + var ErrInvalidDigestAlg = errors.New("invalid content digest algorithm") + var ErrInvalidErrorCode = errors.New("invalid error code") + var ErrInvalidFinishMethod = errors.New("invalid finish method") + var ErrInvalidHashMethod = errors.New("invalid hash method") + var ErrInvalidKeyFormat = errors.New("invalid key format") + var ErrInvalidProofMethod = errors.New("invalid proof method") + var ErrInvalidSigAlg = errors.New("invalid http signature algorithm") + var ErrInvalidStartMode = errors.New("invalid start mode") + var ErrInvalidTokenFlag = errors.New("invalid token flag") + var ErrInvalidTokenRequest = errors.New("invalid token request") + var ErrInvalidTokenResponse = errors.New("invalid token response") + var ErrInvalidURL = errors.New("invalid url") + func MultiToken(tokens ...TokenRequest) requestOption + func SingleToken(token TokenRequest) requestOption + func WithContinue(con ContinueResponse) responseOption + func WithError(err GNAPError) responseOption + func WithExpiry(seconds int) tokenResponseOption + func WithFlag(flag TokenFlag) tokenRequestOption + func WithFlags(flags []TokenFlag) tokenResponseOption + func WithInstanceID(id string) responseOption + func WithInteract(ia IARequest) requestOption + func WithInteractResponse(ia IAResponse) responseOption + func WithKey(key ClientKey) tokenResponseOption + func WithLabel(label string) tokenRequestOption + func WithLabelResponse(label string) tokenResponseOption + func WithManage(manage URL) tokenResponseOption + func WithMultiResponse(tokens ...TokenResponse) responseOption + func WithSingleResponse(token TokenResponse) responseOption + func WithSubject(sub SubRequest) requestOption + func WithSubjectResponse(sub SubResponse) responseOption + func WithUser(user EndUser) requestOption + type ATRequest struct + Multiple []TokenRequest + Single TokenRequest + func (req *ATRequest) UnmarshalJSON(data []byte) error + func (req ATRequest) MarshalJSON() ([]byte, error) + type ATResponse struct + Multiple []TokenResponse + Single TokenResponse + func (req *ATResponse) UnmarshalJSON(data []byte) error + func (req ATResponse) MarshalJSON() ([]byte, error) + type AccessRight struct + Actions []string + Datatypes []string + Identifier string + Locations []string + Privileges []string + Ref string + Type string + func (r *AccessRight) UnmarshalJSON(data []byte) error + func (r AccessRight) MarshalJSON() ([]byte, error) + type Assertion struct + Format AssertionFormat + Value string + type AssertionFormat string + const AFidToken + const AFsaml2 + func (af *AssertionFormat) UnmarshalJSON(data []byte) error + func (af AssertionFormat) MarshalJSON() ([]byte, error) + type ClientDisplay struct + Logo URL + Name string + URI URL + type ClientInstance struct + ClassID string + Display ClientDisplay + Key ClientKey + Ref string + func NewClient(key ClientKey, options ...clientOption) (client ClientInstance, err error) + type ClientKey struct + Cert string + CertS256 string + JWK json.RawMessage + Proof Proofer + Ref string + type ContinueRequest struct + InteractRef string + type ContinueResponse struct + Token ContinueToken + URI URL + Wait int + type ContinueToken struct + ExpiresIn int + Flags []TokenFlag + Label string + Manage URL + Value string + type DigestAlg string + const DigestSha256 + const DigestSha512 + func (alg *DigestAlg) UnmarshalJSON(data []byte) error + func (alg DigestAlg) MarshalJSON() ([]byte, error) + type Discovery struct + AFormats []AssertionFormat + FinishMethods []FinishMethod + GrantRequest URL + KeyProofs []ProofMethod + KeyRotation bool + StartModes []StartMode + SubFormats []subject.Format + type EndUser struct + Assertions []Assertion + Ref string + SubIDs []subject.ID + func (u *EndUser) UnmarshalJSON(data []byte) error + func (u EndUser) MarshalJSON() ([]byte, error) + type FinishMethod string + const MethodPush + const MethodRedirect + func (fm *FinishMethod) UnmarshalJSON(data []byte) error + func (fm FinishMethod) MarshalJSON() ([]byte, error) + type GNAPError struct + Code string + Desc string + func (e GNAPError) Error() string + func (e GNAPError) Is(target error) bool + func (e GNAPError) Unwrap() error + type GrantRequest struct + AccessToken ATRequest + Client ClientInstance + Interact IARequest + Subject SubRequest + User EndUser + func NewRequest(client ClientInstance, options ...requestOption) (req GrantRequest, err error) + type GrantResponse struct + AccessToken ATResponse + Continue ContinueResponse + Error GNAPError + InstanceID string + Interact IAResponse + Subject SubResponse + func NewResponse(options ...responseOption) (res GrantResponse, err error) + type HTTPSig struct + DigestAlg DigestAlg + Method ProofMethod + SigAlg HTTPSigAlg + func (sig HTTPSig) Proof() ProofMethod + type HTTPSigAlg string + const ECDSA_P256_SHA256 + const ECDSA_P384_SHA384 + const ED25519 + const HMAC_SHA256 + const RSA_PSS_SHA512 + const RSA_SHA256 + func (alg *HTTPSigAlg) UnmarshalJSON(data []byte) error + func (alg HTTPSigAlg) MarshalJSON() ([]byte, error) + type HashMethod string + const BLAKE2b_256 + const BLAKE2b_512 + const BLAKE2s_256 + const SHA3_224 + const SHA3_384 + const SHA3_512 + const SHA_256 + const SHA_384 + const SHA_512 + func (hm *HashMethod) UnmarshalJSON(data []byte) error + func (hm HashMethod) MarshalJSON() ([]byte, error) + func (hm HashMethod) Sum(data []byte) []byte + type IACallback struct + Hash string + InteractRef string + func FromQuery(params url.Values) IACallback + func (c IACallback) Encode() url.Values + type IACodeURI struct + Code string + URI URL + type IAFinish struct + HashMethod HashMethod + Method FinishMethod + Nonce string + URI *URL + type IAHints struct + UILocales []string + type IARequest struct + Finish *IAFinish + Hints *IAHints + Start []IAStart + type IAResponse struct + App *URL + CodeURI *IACodeURI + ExpiresIn int + Finish string + Redirect *URL + UserCode string + type IAStart struct + IsRef bool + Mode StartMode + func (ias *IAStart) UnmarshalJSON(data []byte) error + func (ias IAStart) MarshalJSON() ([]byte, error) + type KeyFormat string + const FormatCert + const FormatCertS256 + const FormatJWK + func (kf *KeyFormat) UnmarshalJSON(data []byte) error + func (kf KeyFormat) MarshalJSON() ([]byte, error) + type ProofMethod string + const ProofHTTPSig + const ProofJWS + const ProofJWSD + const ProofMTLS + func (p *ProofMethod) UnmarshalJSON(data []byte) error + func (p ProofMethod) MarshalJSON() ([]byte, error) + func (p ProofMethod) Proof() ProofMethod + type Proofer interface + Proof func() ProofMethod + type StartMode string + const ModeApp + const ModeCode + const ModeCodeURI + const ModeRedirect + func (sm *StartMode) UnmarshalJSON(data []byte) error + func (sm StartMode) MarshalJSON() ([]byte, error) + type SubRequest struct + AFormats []AssertionFormat + SFormats []subject.Format + SubIDs []subject.ID + type SubResponse struct + Assertions []Assertion + SubIDs []subject.ID + UpdatedAt time.Time + type TokenFlag string + const FlagBearer + const FlagDurable + func (tf *TokenFlag) UnmarshalJSON(data []byte) error + func (tf TokenFlag) MarshalJSON() ([]byte, error) + type TokenRequest struct + Access []AccessRight + Flags []TokenFlag + Label string + func NewTokenRequest(rights []AccessRight, options ...tokenRequestOption) (req TokenRequest, err error) + type TokenResponse struct + Access []AccessRight + ExpiresIn int + Flags []TokenFlag + Key ClientKey + Label string + Manage URL + Value string + func NewTokenResponse(value string, access []AccessRight, options ...tokenResponseOption) (res TokenResponse, err error) + type URL struct + func ParseURL(raw string) (URL, error) + func (u *URL) UnmarshalJSON(data []byte) error + func (u URL) MarshalJSON() ([]byte, error)