googleiam

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	UUID          string                 `json:"uuid,omitempty"`
	DisplayName   string                 `json:"display_name,omitempty"`
	Email         string                 `json:"email,omitempty"`
	Phone         *string                `json:"phone,omitempty"`
	PhotoURL      *string                `json:"photo_url,omitempty"`
	EmailVerified *bool                  `json:"email_verified,omitempty"`
	Disabled      *bool                  `json:"disabled,omitempty"`
	CustomClaims  map[string]interface{} `json:"custom_claims,omitempty"`
}

type CreateAccountRequest

type CreateAccountRequest struct {
	DisplayName string  `json:"display_name"`
	Email       string  `json:"email"`
	Password    string  `json:"password"`
	Phone       *string `json:"phone,omitempty"`
	PhotoURL    *string `json:"photo_url,omitempty"`
	TenantID    *string `json:"tenant_id,omitempty"`
}

type CreateAccountResponse

type CreateAccountResponse struct {
	Account        Account        `json:"account"`
	SignInResponse SignInResponse `json:"sign_in_response"`
}

type CreateTenantRequest added in v1.2.0

type CreateTenantRequest struct {
	DisplayName           string `json:"display_name"`
	AllowPasswordSignUp   *bool  `json:"allow_password_sign_up,omitempty"`
	EnableEmailLinkSignIn *bool  `json:"enable_email_link_sign_in,omitempty"`
}

type DecodedToken added in v1.3.1

type DecodedToken struct {
	AuthTime int64                  `json:"auth_time"`
	Issuer   string                 `json:"iss"`
	Audience string                 `json:"aud"`
	Expires  int64                  `json:"exp"`
	IssuedAt int64                  `json:"iat"`
	Subject  string                 `json:"sub,omitempty"`
	UUID     string                 `json:"uuid,omitempty"`
	Claims   map[string]interface{} `json:"-"`
	Firebase FirebaseInfo           `json:"firebase"`
}

type FirebaseInfo added in v1.3.2

type FirebaseInfo struct {
	SignInProvider string                 `json:"sign_in_provider"`
	Tenant         string                 `json:"tenant"`
	Identities     map[string]interface{} `json:"identities"`
}

type GoogleIAM

type GoogleIAM struct {
	// contains filtered or unexported fields
}

func New

func New() (*GoogleIAM, error)

func (*GoogleIAM) AccountExists

func (c *GoogleIAM) AccountExists(ctx context.Context, email string, tenantID ...string) (bool, error)

func (*GoogleIAM) CreateAccount

func (c *GoogleIAM) CreateAccount(ctx context.Context, account CreateAccountRequest) (*CreateAccountResponse, error)

func (*GoogleIAM) CreateTenant added in v1.2.0

func (c *GoogleIAM) CreateTenant(ctx context.Context, request CreateTenantRequest) (*TenantInfo, error)

func (*GoogleIAM) DeleteAccount

func (c *GoogleIAM) DeleteAccount(ctx context.Context, accountUID string, tenantID ...string) error

func (*GoogleIAM) DeleteTenant added in v1.2.0

func (c *GoogleIAM) DeleteTenant(ctx context.Context, tenantID string) error

func (*GoogleIAM) GetAccount added in v1.1.1

func (c *GoogleIAM) GetAccount(ctx context.Context, accountUID string, tenantID ...string) (*Account, error)

func (*GoogleIAM) Initiate added in v1.1.1

func (c *GoogleIAM) Initiate(ctx context.Context, email string, tenantID ...string) error

func (*GoogleIAM) RefreshToken added in v1.3.0

func (c *GoogleIAM) RefreshToken(ctx context.Context, refreshToken string) (*RefreshTokenResponse, error)

RefreshToken exchanges a refresh token for a new ID token and refresh token. The tenant context (if any) is already embedded in the refresh token from the original sign-in.

func (c *GoogleIAM) ResetPasswordLink(ctx context.Context, email string, tenantID ...string) (*string, error)

func (*GoogleIAM) SetCustomUserClaims added in v1.3.3

func (c *GoogleIAM) SetCustomUserClaims(ctx context.Context, accountUID string, claims map[string]interface{}, tenantID ...string) error

func (*GoogleIAM) SignIn

func (c *GoogleIAM) SignIn(ctx context.Context, email, password string, tenantID ...string) (*SignInResponse, error)

func (*GoogleIAM) SignOut

func (c *GoogleIAM) SignOut(ctx context.Context, accountUUID string, tenantID ...string) error

func (*GoogleIAM) UpdateAccount

func (c *GoogleIAM) UpdateAccount(ctx context.Context, accountUID string, account UpdateAccountRequest, tenantID ...string) (*UpdateAccountResponse, error)

func (*GoogleIAM) UpdateAccountPassword

func (c *GoogleIAM) UpdateAccountPassword(
	ctx context.Context,
	accountUID string,
	request UpdatePasswordRequest,
) (*SignInResponse, error)

func (*GoogleIAM) VerifyToken added in v1.1.1

func (c *GoogleIAM) VerifyToken(ctx context.Context, token string, tenantID ...string) (*DecodedToken, error)

type RefreshTokenRequest added in v1.3.0

type RefreshTokenRequest struct {
	GrantType    string `json:"grant_type"`
	RefreshToken string `json:"refresh_token"`
}

type RefreshTokenResponse added in v1.3.0

type RefreshTokenResponse struct {
	ExpiresIn    string `json:"expires_in"`
	TokenType    string `json:"token_type"`
	RefreshToken string `json:"refresh_token"`
	IDToken      string `json:"id_token"`
	UUID         string `json:"user_id"`
	ProjectID    string `json:"project_id"`
}

type SignInRequest

type SignInRequest struct {
	Email             string  `json:"email"`
	Password          string  `json:"password"`
	ReturnSecureToken bool    `json:"returnSecureToken"`
	TenantID          *string `json:"tenantId,omitempty"`
}

type SignInResponse

type SignInResponse struct {
	Kind         string `json:"kind"`
	LocalID      string `json:"localId"`
	Email        string `json:"email"`
	DisplayName  string `json:"displayName"`
	IDToken      string `json:"idToken"`
	Registered   bool   `json:"registered"`
	RefreshToken string `json:"refreshToken"`
	ExpiresIn    string `json:"expiresIn"`
}

type SignOutRequest

type SignOutRequest struct {
	UUID string `json:"uuid"`
}

type TenantInfo added in v1.2.0

type TenantInfo struct {
	ID                    string `json:"id"`
	DisplayName           string `json:"display_name"`
	AllowPasswordSignUp   bool   `json:"allow_password_sign_up"`
	EnableEmailLinkSignIn bool   `json:"enable_email_link_sign_in"`
}

type UpdateAccountRequest

type UpdateAccountRequest struct {
	DisplayName string `json:"display_name"`
}

type UpdateAccountResponse

type UpdateAccountResponse struct {
	Account Account `json:"account"`
}

type UpdatePasswordRequest

type UpdatePasswordRequest struct {
	CurrentPassword string  `json:"current_password"`
	NewPassword     string  `json:"new_password"`
	TenantID        *string `json:"tenant_id,omitempty"`
}

Jump to

Keyboard shortcuts

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