TokenAuth¶
Bases: BaseAuth
Authentication using a pre-supplied token
Attributes:
Name | Type | Description |
---|---|---|
endpoint |
str
|
The token to use for authentication (default: 'api/access-tokens') |
Example
>>> auth = TokenAuth('<token>')
>>> auth.authenticate()
{'Authorization : 'Bearer <token>'}
Source code in src/plankapy/handlers.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
|
__init__(token)
¶
Initialize a TokenAuth instance with a token
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str
|
The token to use for authentication |
required |
Source code in src/plankapy/handlers.py
289 290 291 292 293 294 295 |
|
authenticate(url=None)
¶
Implementation of the authenticate method
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
Not used, but required by the protocol |
None
|
Returns:
Type | Description |
---|---|
dict[str, str]
|
Headers with the token in the |
Source code in src/plankapy/handlers.py
297 298 299 300 301 302 303 304 305 306 |
|