diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-04-16 11:52:15 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-04-16 11:52:15 -0400 |
commit | db41e6d1f630a0ddfbf0807ca73d3d9a81cda222 (patch) | |
tree | a4ba7a67771b6563da2d70e1eada981319bebb51 /gitsrht/app.py | |
parent | a9288d2479dbc1c754462769e4a3c249be0a0ba8 (diff) |
Add basic builds.sr.ht integration
Diffstat (limited to 'gitsrht/app.py')
-rw-r--r-- | gitsrht/app.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gitsrht/app.py b/gitsrht/app.py index d470b41..84a9270 100644 --- a/gitsrht/app.py +++ b/gitsrht/app.py @@ -27,10 +27,14 @@ try: except: pass +meta_sr_ht = cfg("network", "meta") +meta_client_id = cfg("meta.sr.ht", "oauth-client-id") +builds_sr_ht = cfg("builds.sr.ht", "oauth-client-id") + def oauth_url(return_to): - return "{}/oauth/authorize?client_id={}&scopes=profile,keys&state={}".format( - cfg("network", "meta"), - cfg("meta.sr.ht", "oauth-client-id"), + return "{}/oauth/authorize?client_id={}&scopes=profile,keys{}&state={}".format( + meta_sr_ht, meta_client_id, + "," + builds_sr_ht + "/jobs:write" if builds_sr_ht else "", urllib.parse.quote_plus(return_to)) from gitsrht.blueprints.auth import auth |