mirror of
https://gitflic.ru/project/santaspeen/gitflic.git
synced 2026-04-03 06:16:13 +00:00
Add oauth server
This commit is contained in:
13
examples/localhost_oauth.py
Normal file
13
examples/localhost_oauth.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from gitflic import Gitflic, GitflicAuth
|
||||
|
||||
|
||||
# client_id default is "cc2a5d8a-385a-4367-8b2b-bb2412eacb73", Simple gitflic.py app
|
||||
# scope default is GitflicAuthScopes.ALL_READ
|
||||
# redirect_url auto generate at 127.0.0.1:<randint(49152, 65535)>
|
||||
# All OAuth data saved in project directory
|
||||
gf_session = GitflicAuth(localhost_oauth=True)
|
||||
gf = Gitflic(gf_session)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(gf.call('/user/me'))
|
||||
7
examples/oauth.py
Normal file
7
examples/oauth.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from gitflic import Gitflic, GitflicAuth
|
||||
|
||||
|
||||
# client_id default is cc2a5d8a-385a-4367-8b2b-bb2412eacb73, Simple gitflic.py app
|
||||
# scope default is GitflicAuthScopes.ALL_READ
|
||||
# redirect_url default is https://gitflic.ru/settings/oauth/token
|
||||
# All OAuth data saved in project directory
|
||||
Reference in New Issue
Block a user