Discover Packages
github.com/apstndb/adcplus
package
module
Version:
v0.0.0-...-c098392
Opens a new window with list of versions in this module.
Published: Jun 15, 2021
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
adcplus
This package implements oauth2.TokenSource and signer which respects ADC with impersonation.
Automatically uses CLOUDSDK_AUTH_IMPERSONATE_SERVICE_ACCOUNT
environment variable as an impersonation target and a delegation chain.
It respects same variable and syntax of gcloud.
Can override the impersonation target, the delegate chain and the source credential through functional options .
Disclaimer
This package is EXPERIMENTAL.
No responsibility.
May be broken.
Will do breaking changes.
Underlying method
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()
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)
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
Support Self-signed JWT(AIP-4111) for service_account in SmartAccessTokenSource.
Support to override underlying TokenSource.
Support external_account in tokensource.SmartIDTokenSource
.
Re-implement underlying TokenSource to avoid ReuseTokenSource in default.
Add tests.
Replace signJwtHelper with a reliable implementation.
Expand ▾
Collapse ▴
Documentation
¶
WithCredentialsFile returns Option which specifies the path of credentials.
If filename is empty string, it will be ignored.
WithCredentialsJSON returns Option which specifies the content of credentials.
If j is nil or empty slice, it will be ignored.
WithDelegates returns Option which specifies the delegate chain for impersonation.
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.
WithScopes returns Option which specifies the scopes of the access token.
WithTargetPrincipal returns Option which specifies the target principal for impersonation.
Source Files
¶
Directories
¶
examples
Click to show internal directories.
Click to hide internal directories.