auth

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetIDToken = func(ctx context.Context) (string, error) {
	creds, err := google.FindDefaultCredentials(ctx, scopes...)
	if err != nil {
		return "", fmt.Errorf("failed to find default credentials: %w", err)
	}

	token, err := creds.TokenSource.Token()
	if err != nil {
		return "", err
	}

	idToken, ok := token.Extra("id_token").(string)
	if !ok {
		return "", fmt.Errorf("token response did not contain an id_token")
	}

	return idToken, nil
}

GetIDToken retrieves an identity token for the given audience using Google Cloud credentials.

Functions

func GetInfo

func GetInfo() (info.Info, error)

GetInfo retrieves the current user info from gcloud config files.

Types

This section is empty.

Jump to

Keyboard shortcuts

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