File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525 db_username : " op://vault/item/username"
2626 db_password : " op://vault/item/password"
2727 rpki_api_key : " op://vault/item/rpki-api-key"
28+ test_db_username : " op://vault/item/test-username" # optional
29+ test_db_password : " op://vault/item/test-password" # optional
2830 sso_emails :
2931 - " admin@example.com"
3032 routes :
@@ -49,9 +51,11 @@ Secrets are fetched from 1Password via the `op` CLI. The `credentials` block in
4951
5052| Field | Used for |
5153|-------|----------|
52- | `db_username` | RIPE DB REST API username |
53- | `db_password` | RIPE DB REST API password |
54+ | `db_username` | RIPE DB REST API username (production) |
55+ | `db_password` | RIPE DB REST API password (production) |
5456| `rpki_api_key` | RIPE RPKI Management API key |
57+ | `test_db_username` | RIPE test DB username (optional, overrides `db_username` in test mode) |
58+ | `test_db_password` | RIPE test DB password (optional, overrides `db_password` in test mode) |
5559
5660References use the `op://vault/item/field` format. You must be signed in to the 1Password CLI (`op signin`) before running the tool.
5761
Original file line number Diff line number Diff line change 44 db_username : " op://vault/item/username"
55 db_password : " op://vault/item/password"
66 rpki_api_key : " op://vault/item/rpki-api-key"
7+ test_db_username : " op://vault/item/test-username" # optional: overrides db_username for test DB
8+ test_db_password : " op://vault/item/test-password" # optional: overrides db_password for test DB
79 sso_emails :
810 - " admin1@example.com"
911 - " admin2@example.com"
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ class RipeCredentials(BaseModel):
7777 db_username : str
7878 db_password : str
7979 rpki_api_key : str
80+ test_db_username : str | None = None
81+ test_db_password : str | None = None
8082
8183
8284class RipeConfig (BaseModel ):
Original file line number Diff line number Diff line change @@ -50,8 +50,13 @@ def _run(args, parser):
5050
5151 if config .ripe :
5252 creds = config .ripe .credentials
53+ use_test_env = not args .production
54+ if use_test_env and creds .test_db_username and creds .test_db_password :
55+ db_auth = get_ripe_db_auth (creds .test_db_username , creds .test_db_password )
56+ else :
57+ db_auth = get_ripe_db_auth (creds .db_username , creds .db_password )
5358 with RipeClient (
54- db_auth = get_ripe_db_auth ( creds . db_username , creds . db_password ) ,
59+ db_auth = db_auth ,
5560 rpki_key = get_ripe_rpki_key (creds .rpki_api_key ),
5661 maintainer = config .ripe .maintainer ,
5762 dry_run = not args .commit ,
You can’t perform that action at this time.
0 commit comments