misspy.auth¶
misspy.auth.app
¶
Class for using the old-type authentication of Misskey.
Source code in misspy/auth.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
create(name, description, permission=[], callbackUrl=None)
async
¶
create auth app.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
application name |
required |
description |
str
|
application description |
required |
permission |
list
|
application permission. |
[]
|
callbackUrl |
str
|
application callback url. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
AttrDict |
description |
Source code in misspy/auth.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
generate(appSecret)
async
¶
generate auth url
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
appSecret |
str
|
appSecret. app.create is executed to generate it. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
AttrDict |
description |
Source code in misspy/auth.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
get_token(appSecret, token)
async
¶
Get a token for the account with the appSecret generated by app.create and the token generated by app.generate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
appSecret |
str
|
appSecret |
required |
token |
str
|
token |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
user token. |
Source code in misspy/auth.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
misspy.ext.MiAuth¶
misspy.ext.MiAuth
¶
MiAuth
¶
MiAuth extension.
Source code in misspy/ext/MiAuth.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
check()
¶
If authenticated, AttrDict is returned.
Raises:
| Type | Description |
|---|---|
MiAuthFailed
|
If not authenticated. |
Returns:
| Name | Type | Description |
|---|---|---|
AttrDict |
MiAuth result. |
Source code in misspy/ext/MiAuth.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
generate_url(name, icon=None, callback=None, permission=[])
¶
generate MiAuth URL.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
Application name. |
required |
icon |
str
|
Application icon url. Defaults to None. |
None
|
callback |
str
|
Application callback url. Defaults to None. |
None
|
permission |
list | None
|
Application Permission. |
[]
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
MiAuth url. |
Source code in misspy/ext/MiAuth.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |