PasswordAuth¶
Bases: BaseAuth
Authentication using a username or email and password
Attributes:
Name | Type | Description |
---|---|---|
endpoint |
str
|
The token to use for authentication (default: 'api/access-tokens') |
Source code in src/plankapy/handlers.py
233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
|
__init__(username_or_email, password)
¶
Initialize a PasswordAuth instance with a username or email and password
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username_or_email
|
str
|
The username or email to use for authentication |
required |
password
|
str
|
The password to use for authentication |
required |
Example
>>> auth = PasswordAuth('username', 'password')
>>> auth.authenticate('http://planka.instance')
{'Authorization' : 'Bearer <token>'}
Source code in src/plankapy/handlers.py
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
authenticate(url)
¶
Implementation of the authenticate method
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
The base url of the Planka instance |
required |
Returns:
Type | Description |
---|---|
dict[str, str]
|
Headers with the token in the |
Source code in src/plankapy/handlers.py
262 263 264 265 266 267 268 269 270 271 272 |
|