access

package
v5.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package access represents the processing logic of access token.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseClaim

type BaseClaim struct {
	jwt.StandardClaims
}

func (*BaseClaim) Valid

func (c *BaseClaim) Valid() error

Valid is copy from source code, and changed c.VerifyExpiresAt parameter.

type OAuth2AccessTokenClaim

type OAuth2AccessTokenClaim struct {
	AuthTime       int64                  `json:"auth_time"`
	Version        int                    `json:"ver"`
	ClientID       string                 `json:"client_id"`
	UserID         string                 `json:"uid"`
	ProxyPrincipal string                 `json:"proxy,omitempty"`
	Scope          []string               `json:"scp"`
	Confirm        map[string]interface{} `json:"cnf"`
	BaseClaim
}

OAuth2AccessTokenClaim represents access token claim data. based on https://github.com/AthenZ/athenz/blob/e85e233555247f2a4239bf302825e1bbf9493af9/libs/java/auth_core/src/main/java/com/yahoo/athenz/auth/token/AccessToken.java#L468-L476

type Option

type Option func(*atp) error

Option represents a functional options pattern interface

func WithAuthorizedClientIDs

func WithAuthorizedClientIDs(m map[string][]string) Option

WithAuthorizedClientIDs represents set authorizedClientIDs functional option

func WithClientCertificateGoBackSeconds

func WithClientCertificateGoBackSeconds(t string) Option

WithClientCertificateGoBackSeconds represents set clientCertificateGoBackSeconds functional option

func WithClientCertificateOffsetSeconds

func WithClientCertificateOffsetSeconds(t string) Option

WithClientCertificateOffsetSeconds represents set clientCertificateOffsetSeconds functional option

func WithEnableMTLSCertificateBoundAccessToken

func WithEnableMTLSCertificateBoundAccessToken(b bool) Option

WithEnableMTLSCertificateBoundAccessToken represents set enableMTLSCertificateBoundAccessToken functional option

func WithEnableVerifyClientID

func WithEnableVerifyClientID(b bool) Option

WithEnableVerifyClientID represents set enableVerifyClientID functional option

func WithJWKProvider

func WithJWKProvider(jwkp jwk.Provider) Option

WithJWKProvider represents set pubkey provider functional option

type Processor

type Processor interface {
	ParseAndValidateOAuth2AccessToken(cred string, cert *x509.Certificate) (*OAuth2AccessTokenClaim, error)
}

Processor represents the access token parser interface.

func New

func New(opts ...Option) (Processor, error)

New returns the Processor instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL