You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current auth/oidc package provides only the OIDC/PKCE browser flow for token acquisition. It's incomplete — no token storage, no refresh, no HTTP client integration. No raystack project uses it.
Meanwhile, every raystack CLI (frontier, compass, guardian) connects to APIs without authentication, which only works in development/trusted environments. Production APIs require auth, and CLIs have no way to authenticate.
Proposed solution
A complete CLI auth package following the pattern of gh auth login, gcloud auth login, and terraform login:
// Login — opens browser, does OIDC, stores tokenauth.Login(ctx, auth.Config{
Issuer: "https://accounts.google.com",
ClientID: "...",
RedirectURL: "http://localhost:5454",
})
// Token — reads stored token, refreshes if expiredtoken, err:=auth.Token(ctx)
// Client — returns http.Client that auto-attaches the tokenclient:=auth.Client(ctx)
Components
Token acquisition — browser-based OIDC with PKCE (existing code from dropped auth/oidc)
Token storage — secure local storage at ~/.config/raystack/<app>/token.json
Token refresh — auto-refresh expired tokens using refresh_token
HTTP client — http.RoundTripper that reads stored token and attaches to requests
CLI commands — LoginCmd() and LogoutCmd() for easy integration with cli.Execute()
Integration with salt/cli
cli.Execute(
cli.Name("frontier"),
cli.Commands(
auth.LoginCmd(authConfig),
auth.LogoutCmd(),
userCmd, groupCmd,
),
)
// In commands:funcnewListCmd() *cobra.Command {
return&cobra.Command{
RunE: func(cmd*cobra.Command, args []string) error {
client:=auth.Client(cmd)
// make authenticated API calls
},
}
}
Activity
refactor: drop auth/oidc package
refactor: drop auth/ package entirely
refactor: restructure packages and drop unused code