Commit 7278dcf
authored
docs: Correct what _validate_token claims to do (#6689)
* docs: Correct what _validate_token claims to do
The method is named validate, its docstring says it validates the token
against the OAuth2 server, and the caller logs 'Token successfully
validated' afterwards. None of that holds: the bearer scheme only parses
an Authorization header, and the method builds that header itself, so
every token value passes including the empty string. The token is really
verified in _decode_token.
Anyone auditing the auth path is misled into thinking a verification
step happens here. Describe what the call actually checks (that the
discovery document exposes the OAuth2 endpoints) and log that instead.
No behavior change: docstring and log message only. Whether the call
should exist at all is asked separately in #6688.
Signed-off-by: Larry Singleton <166439969+larrysingleton007@users.noreply.github.com>
* refactor: Rename _validate_token to _check_discovery_endpoints
The method never verified the token it takes: it builds a bearer scheme
whose header it supplies itself, so any token value passes. What it does
check is that the discovery document exposes the OAuth2 endpoints, which
is what the docstring already said after the previous commit.
Leaving the old name meant the docstring had to spend its opening
correcting the name. Private method, single caller in the same file, so
the rename is contained.
The access_token parameter stays: the bearer scheme requires a
well-formed Authorization header, and the caller has the token to hand.
Signed-off-by: Larry Singleton <166439969+larrysingleton007@users.noreply.github.com>
---------
Signed-off-by: Larry Singleton <166439969+larrysingleton007@users.noreply.github.com>1 parent fef4e78 commit 7278dcf
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
218 | 227 | | |
219 | 228 | | |
220 | 229 | | |
221 | | - | |
222 | | - | |
| 230 | + | |
| 231 | + | |
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
| |||
0 commit comments