Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateState ¶
GenerateState generates a random state parameter for CSRF protection
Types ¶
type CallbackHandler ¶
type CallbackHandler struct {
// contains filtered or unexported fields
}
func NewCallbackHandler ¶
func NewCallbackHandler(port int, templatesFS embed.FS) *CallbackHandler
func (*CallbackHandler) Close ¶
func (h *CallbackHandler) Close() error
Close gracefully shuts down the callback server
func (*CallbackHandler) SetValidationStatus ¶
func (h *CallbackHandler) SetValidationStatus(status, message string)
SetValidationStatus updates the validation status shown in the browser This should be called from the CLI after token exchange succeeds/fails
func (*CallbackHandler) StartServer ¶
func (h *CallbackHandler) StartServer() error
func (*CallbackHandler) WaitForCode ¶
func (h *CallbackHandler) WaitForCode(timeout time.Duration) (string, error)
WaitForCode waits for the authorization code from the callback
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetOIDCToken ¶
func (c *Client) GetOIDCToken() (*TokenResponse, *CallbackHandler, error)
type IAMClient ¶
type IAMClient struct {
// contains filtered or unexported fields
}
IAMClient handles direct OTC IAM authentication using gophertelekomcloud
func NewIAMClient ¶
NewIAMClient creates a new IAM authentication client
func (*IAMClient) GetIAMToken ¶
GetIAMToken authenticates using OTC IAM user credentials (username/email and password) Returns the unscoped token ID that can be used for further API calls
func (*IAMClient) GetScopedToken ¶
GetScopedToken gets a project-scoped token using an unscoped token
type IAMTokenDomain ¶
type IAMTokenProject ¶
type IAMTokenResponse ¶
type IAMTokenResponse struct {
Token struct {
Methods []string `json:"methods"`
User IAMTokenUser `json:"user"`
AuditIds []string `json:"audit_ids"`
Roles []IAMTokenRole `json:"roles"`
ExpiresAt time.Time `json:"expires_at"`
IssuedAt time.Time `json:"issued_at"`
Project IAMTokenProject `json:"project"`
Catalog []interface{} `json:"catalog"`
Domain IAMTokenDomain `json:"domain"`
} `json:"token"`
}
IAMTokenResponse represents the IAM token response structure
type IAMTokenRole ¶
type IAMTokenUser ¶
type PKCEChallenge ¶
func GeneratePKCE ¶
func GeneratePKCE() (*PKCEChallenge, error)
GeneratePKCE generates PKCE challenge with support for both S256 and plain methods S256 (default): Uses SHA256 hash of the verifier plain: Uses the verifier directly as the challenge (less secure, only for development)
func GeneratePKCEWithMethod ¶
func GeneratePKCEWithMethod(method string) (*PKCEChallenge, error)
GeneratePKCEWithMethod generates PKCE challenge with specified method method: "S256" (recommended, uses SHA256) or "plain" (development only, uses verifier directly)