credentials

package
v3.66.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccessTokenCredentials added in v3.5.0

func NewAccessTokenCredentials(
	accessToken string, opts ...credentials.AccessTokenCredentialsOption,
) *credentials.AccessToken

NewAccessTokenCredentials makes access token credentials object Passed options redefines default values of credentials object internal fields

func NewAnonymousCredentials added in v3.5.0

func NewAnonymousCredentials(
	opts ...credentials.AnonymousCredentialsOption,
) *credentials.Anonymous

NewAnonymousCredentials makes anonymous credentials object Passed options redefines default values of credentials object internal fields

func NewFixedTokenSource added in v3.65.0

func NewFixedTokenSource(token, tokenType string) credentials.TokenSource

NewFixedTokenSource makes fixed token source for OAuth 2.0 token exchange credentials

func NewJWTTokenSource added in v3.65.0

func NewJWTTokenSource(opts ...credentials.JWTTokenSourceOption) (credentials.TokenSource, error)

NewJWTTokenSource makes JWT token source for OAuth 2.0 token exchange credentials

func NewStaticCredentials added in v3.42.3

func NewStaticCredentials(
	user, password, authEndpoint string, opts ...credentials.StaticCredentialsOption,
) *credentials.Static

NewStaticCredentials makes static credentials object

func WithAudience added in v3.65.0

func WithAudience(audience ...string) oauthCredentialsAndJWTCredentialsOption

func WithGrpcDialOptions added in v3.53.3

func WithGrpcDialOptions(opts ...grpc.DialOption) credentials.StaticCredentialsOption

WithGrpcDialOptions option append to static credentials object GRPC dial options

func WithID added in v3.65.0

ID

func WithIssuer added in v3.65.0

func WithIssuer(issuer string) credentials.JWTTokenSourceOption

Issuer

func WithKeyID added in v3.65.0

KeyID

func WithPrivateKey added in v3.65.0

func WithPrivateKey(key interface{}) credentials.JWTTokenSourceOption

PrivateKey

func WithRSAPrivateKeyPEMContent added in v3.65.0

func WithRSAPrivateKeyPEMContent(key []byte) credentials.JWTTokenSourceOption

PrivateKey

func WithRSAPrivateKeyPEMFile added in v3.65.0

func WithRSAPrivateKeyPEMFile(path string) credentials.JWTTokenSourceOption

PrivateKey

func WithSigningMethod added in v3.65.0

func WithSigningMethod(method jwt.SigningMethod) credentials.JWTTokenSourceOption

SigningMethod

func WithSourceInfo added in v3.5.0

func WithSourceInfo(sourceInfo string) credentials.SourceInfoOption

WithSourceInfo option append to credentials object the source info for reporting source info details on error case

func WithSubject added in v3.65.0

func WithSubject(subject string) credentials.JWTTokenSourceOption

Subject

func WithTokenTTL added in v3.65.0

TokenTTL

Types

type Credentials

type Credentials interface {
	// Token must return actual token or error
	Token(ctx context.Context) (string, error)
}

Credentials is an interface of YDB credentials required for connect with YDB

func NewOauth2TokenExchangeCredentials added in v3.65.0

func NewOauth2TokenExchangeCredentials(
	opts ...credentials.Oauth2TokenExchangeCredentialsOption,
) (Credentials, error)

NewOauth2TokenExchangeCredentials makes OAuth 2.0 token exchange protocol credentials object https://www.rfc-editor.org/rfc/rfc8693

type Oauth2TokenExchangeCredentialsOption added in v3.65.0

type Oauth2TokenExchangeCredentialsOption = credentials.Oauth2TokenExchangeCredentialsOption

func WithActorToken added in v3.65.0

ActorTokenSource

func WithFixedActorToken added in v3.65.0

func WithFixedActorToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption

ActorTokenSource

func WithFixedSubjectToken added in v3.65.0

func WithFixedSubjectToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption

SubjectTokenSource

func WithGrantType added in v3.65.0

func WithGrantType(grantType string) Oauth2TokenExchangeCredentialsOption

GrantType

func WithJWTActorToken added in v3.65.0

ActorTokenSource

func WithJWTSubjectToken added in v3.65.0

SubjectTokenSource

func WithRequestTimeout added in v3.65.0

func WithRequestTimeout(timeout time.Duration) Oauth2TokenExchangeCredentialsOption

RequestTimeout

func WithRequestedTokenType added in v3.65.0

func WithRequestedTokenType(requestedTokenType string) Oauth2TokenExchangeCredentialsOption

RequestedTokenType

func WithResource added in v3.65.0

func WithResource(resource string) Oauth2TokenExchangeCredentialsOption

Resource

func WithScope added in v3.65.0

func WithScope(scope ...string) Oauth2TokenExchangeCredentialsOption

Scope

func WithSubjectToken added in v3.65.0

func WithSubjectToken(subjectToken credentials.TokenSource) Oauth2TokenExchangeCredentialsOption

SubjectTokenSource

func WithTokenEndpoint added in v3.65.0

func WithTokenEndpoint(endpoint string) Oauth2TokenExchangeCredentialsOption

TokenEndpoint

type Token added in v3.65.0

type Token = credentials.Token

type TokenSource added in v3.65.0

type TokenSource = credentials.TokenSource

Jump to

Keyboard shortcuts

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