Documentation ¶
Index ¶
Constants ¶
View Source
const ( FirebaseAPIKey = "AIzaSyCxsrwjABEF-dWLzUqmwiL-ct02cnG9GCs" TokenBaseURL = "https://securetoken.googleapis.com" EnvVarCloudQueryAPIKey = "CLOUDQUERY_API_KEY" ExpiryBuffer = 60 * time.Second )
Variables ¶
View Source
var UndefinedToken = Token{Type: Undefined, Value: ""}
Functions ¶
func IsTokenExpiredError ¶ added in v1.6.3
func ReadRefreshToken ¶
ReadRefreshToken reads the refresh token from the token file
func SaveRefreshToken ¶
SaveRefreshToken saves the refresh token to the token file
Types ¶
type TokenClient ¶
type TokenClient struct {
// contains filtered or unexported fields
}
func NewTokenClient ¶
func NewTokenClient() *TokenClient
func (*TokenClient) GetToken ¶
func (tc *TokenClient) GetToken() (Token, error)
GetToken returns the ID token If CLOUDQUERY_API_KEY is set, it returns that value, otherwise it returns an ID token generated from the refresh token.
func (*TokenClient) GetTokenType ¶ added in v1.6.0
func (tc *TokenClient) GetTokenType() TokenType
GetTokenType returns the type of token that will be returned by GetToken
type TokenError ¶ added in v1.6.3
type TokenError struct { Body []byte `json:"-"` ErrorDetails struct { Code int `json:"code"` Message string `json:"message"` Status string `json:"status"` } `json:"error"` }
func TokenErrorFromBody ¶ added in v1.6.3
func TokenErrorFromBody(body []byte) *TokenError
func (TokenError) Error ¶ added in v1.6.3
func (t TokenError) Error() string
Click to show internal directories.
Click to hide internal directories.