package credentials

import "github.com/ydb-platform/ydb-go-sdk/v3/credentials"

Index

Functions

func NewAccessTokenCredentials

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

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

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

func NewFixedTokenSource

func NewFixedTokenSource(token, tokenType string) credentials.TokenSource

NewFixedTokenSource makes fixed token source for OAuth 2.0 token exchange credentials

func NewJWTTokenSource

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

NewJWTTokenSource makes JWT token source for OAuth 2.0 token exchange credentials

func NewStaticCredentials

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

NewStaticCredentials makes static credentials object

func WithAudience

func WithAudience(audience ...string) oauthCredentialsAndJWTCredentialsOption

func WithGrpcDialOptions

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

WithGrpcDialOptions option append to static credentials object GRPC dial options

func WithID

ID

func WithIssuer

func WithIssuer(issuer string) credentials.JWTTokenSourceOption

Issuer

func WithKeyID

KeyID

func WithPrivateKey

func WithPrivateKey(key interface{}) credentials.JWTTokenSourceOption

PrivateKey

func WithRSAPrivateKeyPEMContent

func WithRSAPrivateKeyPEMContent(key []byte) credentials.JWTTokenSourceOption

PrivateKey

func WithRSAPrivateKeyPEMFile

func WithRSAPrivateKeyPEMFile(path string) credentials.JWTTokenSourceOption

PrivateKey

func WithSigningMethod

func WithSigningMethod(method jwt.SigningMethod) credentials.JWTTokenSourceOption

SigningMethod

func WithSourceInfo

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

func WithSubject(subject string) credentials.JWTTokenSourceOption

Subject

func WithTokenTTL

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

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

type Oauth2TokenExchangeCredentialsOption = credentials.Oauth2TokenExchangeCredentialsOption

func WithActorToken

ActorTokenSource

func WithFixedActorToken

func WithFixedActorToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption

ActorTokenSource

func WithFixedSubjectToken

func WithFixedSubjectToken(token, tokenType string) Oauth2TokenExchangeCredentialsOption

SubjectTokenSource

func WithGrantType

func WithGrantType(grantType string) Oauth2TokenExchangeCredentialsOption

GrantType

func WithJWTActorToken

ActorTokenSource

func WithJWTSubjectToken

SubjectTokenSource

func WithRequestTimeout

func WithRequestTimeout(timeout time.Duration) Oauth2TokenExchangeCredentialsOption

RequestTimeout

func WithRequestedTokenType

func WithRequestedTokenType(requestedTokenType string) Oauth2TokenExchangeCredentialsOption

RequestedTokenType

func WithResource

func WithResource(resource string) Oauth2TokenExchangeCredentialsOption

Resource

func WithScope

func WithScope(scope ...string) Oauth2TokenExchangeCredentialsOption

Scope

func WithSubjectToken

func WithSubjectToken(subjectToken credentials.TokenSource) Oauth2TokenExchangeCredentialsOption

SubjectTokenSource

func WithTokenEndpoint

func WithTokenEndpoint(endpoint string) Oauth2TokenExchangeCredentialsOption

TokenEndpoint

type Token

type Token = credentials.Token

type TokenSource

type TokenSource = credentials.TokenSource

Source Files

credentials.go options.go

Version
v3.71.0
Published
Jun 5, 2024
Platform
darwin/amd64
Imports
5 packages
Last checked
10 minutes ago

Tools for package owners.