Commit 1557365
feat(cdk): add token_prefix support to SessionTokenAuthenticator
This adds a token_prefix field to SessionTokenRequestApiKeyAuthenticator
that allows prepending a custom prefix to the session token when injecting
it into requests.
This is useful for APIs that require a specific prefix before the token,
such as Django REST Framework APIs that expect 'Authorization: Token <value>'
format instead of the standard Bearer format.
Changes:
- Add token_prefix field to SessionTokenRequestApiKeyAuthenticator in schema
- Create PrefixedTokenProvider wrapper class in token_provider.py
- Update factory to wrap token provider with prefix when token_prefix is set
- Regenerate Pydantic models from schema
- Add unit tests for PrefixedTokenProvider
Closes #884
Co-Authored-By: Ryan Waskewich <ryan.waskewich@airbyte.io>1 parent 9b23860 commit 1557365
5 files changed
Lines changed: 148 additions & 62 deletions
File tree
- airbyte_cdk/sources/declarative
- auth
- models
- parsers
- unit_tests/sources/declarative/auth
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2067 | 2067 | | |
2068 | 2068 | | |
2069 | 2069 | | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
2070 | 2078 | | |
2071 | 2079 | | |
2072 | 2080 | | |
| |||
0 commit comments