|
1 | 1 | """Constants, primarily used for LDAP enrollment preferences.""" |
2 | 2 |
|
| 3 | +from typing import TypedDict |
| 4 | + |
| 5 | + |
| 6 | +class LDAPGroupMapping(TypedDict): |
| 7 | + """Mapping of an LDAP group to its Discord role ID and GitHub team ID.""" |
| 8 | + |
| 9 | + discord_role_id: int |
| 10 | + github_team_slug: str |
| 11 | + |
| 12 | + |
3 | 13 | # Users are only checked for enrollment if they have this role. This doesn't grant them any |
4 | 14 | # permissions, it is for performance to avoid iterating roles for every other user in the guild. |
5 | 15 | LDAP_BASE_STAFF_ROLE = 267630620367257601 |
6 | 16 |
|
7 | | -# This is a mapping of LDAP groups to Discord roles. It is used to determine which users should be |
8 | | -# eligible for LDAP enrollment. |
9 | | -LDAP_ROLE_MAPPING = { |
10 | | - "devops": 409416496733880320, |
11 | | - "administrators": 267628507062992896, |
12 | | - "moderators": 267629731250176001, |
13 | | - "coredevs": 587606783669829632, |
14 | | - "events": 787816728474288181, |
15 | | - "directors": 267627879762755584, |
| 17 | +# This is a mapping of LDAP groups to Discord role IDs and GitHub team IDs. It is used to determine |
| 18 | +# which users should be eligible for LDAP enrollment. |
| 19 | +LDAP_ROLE_MAPPING: dict[str, LDAPGroupMapping] = { |
| 20 | + "devops": {"discord_role_id": 409416496733880320, "github_team_slug": "devops"}, |
| 21 | + "administrators": {"discord_role_id": 267628507062992896, "github_team_slug": "admins"}, |
| 22 | + "moderators": {"discord_role_id": 267629731250176001, "github_team_slug": "moderators"}, |
| 23 | + "coredevs": {"discord_role_id": 587606783669829632, "github_team_slug": "core-developers"}, |
| 24 | + "events": {"discord_role_id": 787816728474288181, "github_team_slug": "events"}, |
| 25 | + "directors": {"discord_role_id": 267627879762755584, "github_team_slug": "directors"}, |
16 | 26 | } |
0 commit comments