Skip to main content

Creating an Organizations service

You should create a dedicated Organizations service if you want to:

  • Limit access to the organizations you've previously defined so that some users only have access to some repositories OR
  • Customize commit messages by repository (e.g., adding a JIRA ticket to your commit messages based on the repository)

This guide will walk you through everything you need to know to create such a service.

Organizations service template and API

You have two main options for building this service. You can:

  1. (Recommended) Fork our Organizations service template and modify it to meet your needs. Please see the README for how to spin this up quickly. It can be as simple as updating a CSV file.
  2. Build your own service that fulfills the GraphQL contract using any GraphQL stack (e.g., NodeJS, Rust, C#, etc.)

We generally recommend forking the template and modifying it as, in most cases, that will be faster and easier than building it yourself. Regardless of which one you choose, however, some developer time will be required on your end.

Connector variables

Once you've created an organizations service, configure your Connector to call it under the moderne.custom-integrations namespace. These variables/arguments must be combined with the ones found in other steps in the Configuring the Moderne Connector guide.

Access scoping is fail-closed: if the service is unreachable or returns an error, a user is restricted to no organizations rather than the full hierarchy. Commit-message customization is fail-open: an unreachable or erroring service leaves the original commit message unchanged, so it never blocks a commit.

Environment variables:

Variable NameRequiredDefaultDescription
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_URItrueThe URL of your organizations service's GraphQL endpoint (e.g., https://org-service.internal/graphql).
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_USERNAMEfalsenullUsername, if the service requires basic authentication.
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_PASSWORDfalsenullPassword, if the service requires basic authentication.
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_BEARERTOKENfalsenullBearer token, if the service uses token authentication. Takes precedence over username/password when both are set.
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_SKIPSSLfalsefalseWhether to skip SSL/TLS verification for the Connector's calls to this service. Set to true if the service uses a self-signed SSL/TLS certificate.
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_SKIPVALIDATECONNECTIVITYfalsefalseBy default, on Connector startup, we validate that we can reach this service and fail to start the Connector if we cannot. Set to true to skip this validation (e.g., if the service may be unavailable when the Connector boots).
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_PROXY_HOSTfalseHostname of a forward proxy to use for the Connector's calls to this service.
MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_PROXY_PORTfalsePort of the forward proxy.

Example:

docker run \
# ... Existing variables
-e MODERNE_CUSTOMINTEGRATIONS_ORGANIZATIONSERVICE_URI=https://org-service.internal/graphql \
# ... Additional variables

If you previously pointed the Moderne agent at this service with moderne.agent.organization.service.url, that setting is not carried over automatically — reconfigure it under moderne.custom-integrations.organization-service.uri as shown above. The value must be the service's full GraphQL endpoint including the /graphql path, not just the host.