|
11 | 11 | description="Apricot is a proxy for delegating LDAP requests to an OpenID Connect backend.",
|
12 | 12 | )
|
13 | 13 | # Common options needed for all backends
|
14 |
| - parser.add_argument("-b", "--backend", type=OAuthBackend, help="Which OAuth backend to use.") |
15 |
| - parser.add_argument("-d", "--domain", type=str, help="Which domain users belong to.") |
| 14 | + parser.add_argument( |
| 15 | + "-b", "--backend", type=OAuthBackend, help="Which OAuth backend to use." |
| 16 | + ) |
| 17 | + parser.add_argument( |
| 18 | + "-d", "--domain", type=str, help="Which domain users belong to." |
| 19 | + ) |
16 | 20 | parser.add_argument("-i", "--client-id", type=str, help="OAuth client ID.")
|
17 |
| - parser.add_argument("-p", "--port", type=int, default=1389, help="Port to run on.") |
18 |
| - parser.add_argument("-s", "--client-secret", type=str, help="OAuth client secret.") |
19 |
| - parser.add_argument("--background-refresh", action="store_true", default=False, |
20 |
| - help="Refresh in the background instead of as needed per request") |
21 |
| - parser.add_argument("--debug", action="store_true", help="Enable debug logging.") |
22 |
| - parser.add_argument("--disable-mirrored-groups", action="store_false", |
23 |
| - dest="enable_mirrored_groups", default=True, |
24 |
| - help="Disable creation of mirrored groups.") |
25 |
| - parser.add_argument("--refresh-interval", type=int, default=60, |
26 |
| - help="How often to refresh the database in seconds") |
| 21 | + parser.add_argument( |
| 22 | + "-p", "--port", type=int, default=1389, help="Port to run on." |
| 23 | + ) |
| 24 | + parser.add_argument( |
| 25 | + "-s", "--client-secret", type=str, help="OAuth client secret." |
| 26 | + ) |
| 27 | + parser.add_argument( |
| 28 | + "--background-refresh", |
| 29 | + action="store_true", |
| 30 | + default=False, |
| 31 | + help="Refresh in the background instead of as needed per request", |
| 32 | + ) |
| 33 | + parser.add_argument( |
| 34 | + "--debug", action="store_true", help="Enable debug logging." |
| 35 | + ) |
| 36 | + parser.add_argument( |
| 37 | + "--disable-mirrored-groups", |
| 38 | + action="store_false", |
| 39 | + default=True, |
| 40 | + dest="enable_mirrored_groups", |
| 41 | + help="Disable creation of mirrored groups.", |
| 42 | + ) |
| 43 | + parser.add_argument( |
| 44 | + "--refresh-interval", |
| 45 | + type=int, |
| 46 | + default=60, |
| 47 | + help="How often to refresh the database in seconds", |
| 48 | + ) |
27 | 49 |
|
28 | 50 | # Options for Microsoft Entra backend
|
29 | 51 | entra_group = parser.add_argument_group("Microsoft Entra")
|
30 |
| - entra_group.add_argument("-t", "--entra-tenant-id", type=str, help="Microsoft Entra tenant ID.", required=False) |
| 52 | + entra_group.add_argument( |
| 53 | + "--entra-tenant-id", type=str, help="Microsoft Entra tenant ID." |
| 54 | + ) |
31 | 55 |
|
32 | 56 | # Options for Keycloak backend
|
33 | 57 | keycloak_group = parser.add_argument_group("Keycloak")
|
34 |
| - keycloak_group.add_argument("--keycloak-base-url", type=str, help="Keycloak base URL.", required=False) |
35 |
| - keycloak_group.add_argument("--keycloak-realm", type=str, help="Keycloak Realm.", required=False) |
| 58 | + keycloak_group.add_argument( |
| 59 | + "--keycloak-base-url", type=str, help="Keycloak base URL." |
| 60 | + ) |
| 61 | + keycloak_group.add_argument( |
| 62 | + "--keycloak-realm", type=str, help="Keycloak Realm." |
| 63 | + ) |
36 | 64 | # Options for Redis cache
|
37 | 65 | redis_group = parser.add_argument_group("Redis")
|
38 |
| - redis_group.add_argument("--redis-host", type=str, help="Host for Redis server.") |
39 |
| - redis_group.add_argument("--redis-port", type=int, help="Port for Redis server.") |
| 66 | + redis_group.add_argument( |
| 67 | + "--redis-host", type=str, help="Host for Redis server." |
| 68 | + ) |
| 69 | + redis_group.add_argument( |
| 70 | + "--redis-port", type=int, help="Port for Redis server." |
| 71 | + ) |
40 | 72 | # Options for TLS
|
41 | 73 | tls_group = parser.add_argument_group("TLS")
|
42 |
| - tls_group.add_argument("--tls-certificate", type=str, help="Location of TLS certificate (pem).") |
43 |
| - tls_group.add_argument("--tls-port", type=int, default=1636, help="Port to run on with encryption.") |
44 |
| - tls_group.add_argument("--tls-private-key", type=str, help="Location of TLS private key (pem).") |
| 74 | + tls_group.add_argument( |
| 75 | + "--tls-certificate", type=str, help="Location of TLS certificate (pem)." |
| 76 | + ) |
| 77 | + tls_group.add_argument( |
| 78 | + "--tls-port", type=int, default=1636, help="Port to run on with encryption." |
| 79 | + ) |
| 80 | + tls_group.add_argument( |
| 81 | + "--tls-private-key", type=str, help="Location of TLS private key (pem)." |
| 82 | + ) |
45 | 83 | # Parse arguments
|
46 | 84 | args = parser.parse_args()
|
47 | 85 |
|
|
0 commit comments