Managing Connections in Gitlab Deployment Extension

I have been implementing a GitLab repository to track my company’s Auth0 code and settings with the assistance of the GitLab Deployment Extension. We have run into an issue with managing Connections, however. The sample repository does not provide examples for managing the settings of the Connections themselves (only the scripts for login/get_user) so I have dug into the code of the extension and deduced that the Connection settings are stored under /connections/connection-name.json using the Management API’s Create Connection format.

I have implemented such in our repository, with the JSON file looking like this:

{
  "name": "PostgreSQL",
  "strategy": "auth0",
  "options": {
    "mfa": {
      "active": true,
      "return_enroll_settings": true
    },
    "passwordPolicy": "good",
    "disable_signup": false,
    "requires_username": false,
    "brute_force_protection": true,
    "strategy_version": 2,
    "enabledDatabaseCustomization": true,
  },
  "is_domain_connection": false,
  "realms": ["PostgreSQL"],
  "enabled_clients": [
    "..."
  ]
  "metadata": {}
}

Unfortunately when I attempt to deploy this, I get the following deployment error in the extension:

Problem creating connections {"name":"postgresql"}
APIError: {"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'Missing required property: strategy'.","errorCode":"invalid_body"}

I have confirmed multiple times that the strategy field is provided in the JSON file, and am unsure how to proceed in debugging this issue.

With some more digging I found via the auth-deploy-cli application that a database connection’s configuration should be stored under /database-connection/dbname/database.json. This is missing from most deployment examples and documentation.

Thanks a lot for sharing it with the rest of community!