Skip to content

Commit f358ea1

Browse files
authored
feat(cli): change default OAuth scopes to email and profile (#29)
- Update default scope from "read write" to "email profile" to align with OIDC standard scopes - Update test fixtures to match new default scope
1 parent 3a06cc7 commit f358ea1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func registerFlags(cmd *cobra.Command) {
119119
cmd.PersistentFlags().
120120
IntVar(&flagCallbackPort, "port", 0, "Local callback port for browser flow (default: 8888 or CALLBACK_PORT env)")
121121
cmd.PersistentFlags().
122-
StringVar(&flagScope, "scope", "", "Space-separated OAuth scopes (default: \"read write\")")
122+
StringVar(&flagScope, "scope", "", "Space-separated OAuth scopes (default: \"email profile\")")
123123
cmd.PersistentFlags().
124124
StringVar(&flagTokenFile, "token-file", "", "Token storage file (default: .authgate-tokens.json or TOKEN_FILE env)")
125125
cmd.PersistentFlags().
@@ -182,7 +182,7 @@ func loadConfig() *AppConfig {
182182
cfg.ForceDevice = flagDevice
183183
cfg.ServerURL = getConfig(flagServerURL, "SERVER_URL", "http://localhost:8080")
184184
cfg.ClientSecret = getConfig(flagClientSecret, "CLIENT_SECRET", "")
185-
cfg.Scope = getConfig(flagScope, "SCOPE", "read write")
185+
cfg.Scope = getConfig(flagScope, "SCOPE", "email profile")
186186

187187
// Resolve callback port (int flag needs special handling).
188188
portStr := ""

main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func testConfig(t *testing.T) *AppConfig {
2828
return &AppConfig{
2929
ServerURL: serverURL,
3030
ClientID: "test-client",
31-
Scope: "read write",
31+
Scope: "email profile",
3232
RetryClient: rc,
3333
Store: credstore.NewTokenFileStore(
3434
filepath.Join(t.TempDir(), "tokens.json"),
@@ -235,7 +235,7 @@ func TestBuildAuthURL_ContainsRequiredParams(t *testing.T) {
235235
ServerURL: "http://localhost:8080",
236236
ClientID: "my-client-id",
237237
RedirectURI: "http://localhost:8888/callback",
238-
Scope: "read write",
238+
Scope: "email profile",
239239
Endpoints: defaultEndpoints("http://localhost:8080"),
240240
}
241241

0 commit comments

Comments
 (0)