~sircmpwn/names.sr.ht

ref: 4befa4e5942b52045dc9ef9bcd3473389db71d61 names.sr.ht/names/oauth.py -rw-r--r-- 556 bytes
4befa4e5Drew DeVault Add tables for remaining TLDs with special reqs 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from srht.config import cfg
from srht.oauth import AbstractOAuthService
from names.types import User

client_id = cfg("names.sr.ht", "oauth-client-id")
client_secret = cfg("names.sr.ht", "oauth-client-secret")
gitsrht_cid = cfg("git.sr.ht", "oauth-client-id")

class NamesOAuthService(AbstractOAuthService):
    def __init__(self):
        super().__init__(client_id, client_secret,
            required_scopes=[
                "profile",
                f"{gitsrht_cid}/data",
                f"{gitsrht_cid}/info:write",
            ], user_class=User)