Documentation
¶
Index ¶
Constants ¶
View Source
const ActiveUserKey = "active_user"
View Source
const KnownUsersKey = "known_users"
View Source
const ServiceName = "datum-mcp-auth"
Variables ¶
View Source
var ErrNoActiveUser = errors.New("no active user set. Please login first")
Functions ¶
func DeriveAPIHostname ¶
func GetAPIHostname ¶
func GetActiveUserKey ¶
func GetSubject ¶
GetSubject returns the current user's subject (user ID) from stored credentials.
func GetTokenSource ¶
func GetTokenSource(ctx context.Context) (oauth2.TokenSource, error)
Types ¶
type StoredCredentials ¶
type StoredCredentials struct {
Hostname string `json:"hostname"`
APIHostname string `json:"api_hostname"`
ClientID string `json:"client_id"`
EndpointAuthURL string `json:"endpoint_auth_url"`
EndpointTokenURL string `json:"endpoint_token_url"`
Scopes []string `json:"scopes"`
Token *oauth2.Token `json:"token"`
UserName string `json:"user_name"`
UserEmail string `json:"user_email"`
Subject string `json:"subject"`
}
func GetActiveCredentials ¶
func GetActiveCredentials() (*StoredCredentials, string, error)
func GetStoredCredentials ¶
func GetStoredCredentials(userKey string) (*StoredCredentials, error)
Click to show internal directories.
Click to hide internal directories.