adcplus

package module
v0.0.0-...-c098392 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: MIT Imports: 1 Imported by: 0

README

adcplus

Go Reference

This package implements oauth2.TokenSource and signer which respects ADC with impersonation.

Disclaimer

This package is EXPERIMENTAL.

  • No responsibility.
  • May be broken.
  • Will do breaking changes.

Underlying method

signer.SmartSigner
credential/impersonate yes no
authorized_user Credentials API Not Supported
service_account Credentials API Sign by JSON key
external_account Credentials API Credentials API as itself
compute_metadata Credentials API Credentials API as itself
App Engine 1st gen(only if WithExperimentalAppEngineSigner(true)) Credentials API appengine.SignBytes()
tokensource.SmartAccessTokenSource
credential/impersonate yes no
authorized_user Credentials API ADC(refresh token flow)
service_account Credentials API ADC(jwt-bearer token flow)
external_account Credentials API ADC(STS)
compute_metadata Credentials API ADC(token endpoint)
tokensource.SmartIDTokenSource
credential/impersonate yes no
authorized_user Credentials API Not Supported
service_account Credentials API ADC(jwt-bearer flow)
external_account Credentials API Not Supported(TODO: retrieve using STS)
compute_metadata Credentials API ADC(identity endpoint)

TODO

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config.AdcPlusConfig) error

func WithCredentialsFile

func WithCredentialsFile(filename string) Option

WithCredentialsFile returns Option which specifies the path of credentials. If filename is empty string, it will be ignored.

func WithCredentialsJSON

func WithCredentialsJSON(j []byte) Option

WithCredentialsJSON returns Option which specifies the content of credentials. If j is nil or empty slice, it will be ignored.

func WithDelegates

func WithDelegates(delegates ...string) Option

WithDelegates returns Option which specifies the delegate chain for impersonation.

func WithExperimentalAppEngineSigner

func WithExperimentalAppEngineSigner(enable bool) Option

WithExperimentalAppEngineSigner returns Option which specifies to use appengine.SignBytes by Signer. Caution: It makes the signer to require an App Engine context. If you don't know this meaning, don't set this option.

func WithScopes

func WithScopes(scopes ...string) Option

WithScopes returns Option which specifies the scopes of the access token.

func WithTargetPrincipal

func WithTargetPrincipal(targetPrincipal string) Option

WithTargetPrincipal returns Option which specifies the target principal for impersonation.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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