Skip to content

Commit f23a637

Browse files
committed
fix(auth): remove honeytokens:read from default scopes
honeytokens:read is implied by honeytokens:write, so requesting it explicitly is redundant.
1 parent d5dd039 commit f23a637

4 files changed

Lines changed: 4 additions & 10 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
### Changed
22

3-
- `ggshield auth login` now requests broader default scopes (`scan`, `honeytokens:read`, `honeytokens:write`, `honeytokens:check`, `nhi:send-inventory`). If any scope is not granted, a warning is printed but login still succeeds.
3+
- `ggshield auth login` now requests broader default scopes (`scan`, `honeytokens:write`, `honeytokens:check`, `nhi:send-inventory`). If any scope is not granted, a warning is printed but login still succeeds.

ggshield/cmd/auth/login.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ def print_default_instance_message(config: Config) -> None:
112112
type=str,
113113
help=(
114114
"Space-separated list of extra scopes to request in addition to the default"
115-
" scopes (scan, honeytokens:read, honeytokens:write, honeytokens:check,"
116-
" nhi:send-inventory)."
115+
" scopes (scan, honeytokens:write, honeytokens:check, nhi:send-inventory)."
117116
),
118117
metavar="SCOPES",
119118
)
@@ -167,8 +166,8 @@ def login_cmd(
167166
Alternatively, you can use `--method token` to authenticate using an already existing token.
168167
The minimum required scope for the token is `scan`.
169168
170-
By default, the created token will have the `scan`, `honeytokens:read`,
171-
`honeytokens:write`, `honeytokens:check`, and `nhi:send-inventory` scopes.
169+
By default, the created token will have the `scan`, `honeytokens:write`,
170+
`honeytokens:check`, and `nhi:send-inventory` scopes.
172171
Use the `--scopes` option to request extra scopes. You can find the list of
173172
available scopes in [GitGuardian API documentation][1].
174173

ggshield/verticals/auth/oauth.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
SCAN_SCOPE = "scan"
3030
DEFAULT_SCOPES = [
3131
SCAN_SCOPE,
32-
"honeytokens:read",
3332
"honeytokens:write",
3433
"honeytokens:check",
3534
"nhi:send-inventory",

tests/unit/cmd/auth/test_login.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"name": "key",
4646
"scope": [
4747
"scan",
48-
"honeytokens:read",
4948
"honeytokens:write",
5049
"honeytokens:check",
5150
"nhi:send-inventory",
@@ -77,7 +76,6 @@
7776
"created_at": "2021-01-01T00:00:00+00:00",
7877
"scopes": [
7978
"scan",
80-
"honeytokens:read",
8179
"honeytokens:write",
8280
"honeytokens:check",
8381
"nhi:send-inventory",
@@ -702,7 +700,6 @@ def test_scopes(self, cli_fs_runner, monkeypatch):
702700
self._assert_open_url(
703701
scope_set={
704702
"scan",
705-
"honeytokens:read",
706703
"honeytokens:write",
707704
"honeytokens:check",
708705
"nhi:send-inventory",
@@ -947,7 +944,6 @@ def _assert_open_url(
947944
if scope_set is None:
948945
scope_set = {
949946
"scan",
950-
"honeytokens:read",
951947
"honeytokens:write",
952948
"honeytokens:check",
953949
"nhi:send-inventory",

0 commit comments

Comments
 (0)