Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCIPAuthenticator ¶
type GCIPAuthenticator struct {
UserAuthClient
}
GCIPAuthenticator is a struct that authenticates users using Firebase Auth, which is part of Google Cloud Identity Platform (GCIP). It implements the UserAuthClient interface.
func NewGCIPAuthenticator ¶
func NewGCIPAuthenticator(client UserAuthClient) *GCIPAuthenticator
NewGCIPAuthenticator creates a new GCIPAuthenticator instance.
func (GCIPAuthenticator) Authenticate ¶
Authenticate authenticates a user using the provided ID token.
type GCPTokenGenerator ¶
type GCPTokenGenerator struct{}
GCPTokenGenerator generates an authentication token for processes running inside GCP.
func (GCPTokenGenerator) Generate ¶
Taken from https://cloud.google.com/docs/authentication/get-id-token#metadata-server
type User ¶
type User struct {
ID string
// GitHubUserID is the string representation of the GitHub user's integer ID,
// as returned by Firebase Auth.
//
// It is a pointer because it may be nil if the user is authenticated but not
// linked to GitHub, or if the ID hasn't been verified against the GitHub API yet.
// Verification is deferred until needed to keep most authenticated calls fast.
GitHubUserID *string
}
User contains the details of an authenticated user.
func (User) HasGitHubUserID ¶
HasGitHubID checks if the authenticated user matches a specific GitHub integer ID. It handles the necessary string-to-int64 conversion safely.
type UserAuthClient ¶
type UserAuthClient interface {
VerifyIDToken(context.Context, string) (*firebaseauth.Token, error)
}
UserAuthClient is an interface that defines the methods for interacting with a user authentication provider.