Skip to content

CMSgov/ab2d-properties

Repository files navigation

AB2D Properties Service

This service is used to save runtime variables for services to access. Unlike an envrionment variable, these values can be updated at runtime and shared across services. Individual application code should retrieve the values of these properties at any time, allowing them to change their behaviour across the system or coordinate services.

Examples include the status of BFD. If one service detects BFD is down, it can update a value indicating this. This prevents other services from querying BFD or creating a backlog of tasks whith no ability to satisfy them. Another example is coordinating scaling.

The interface provides the following endpoints:

GET /properties

  • Lists the existing properties (key and value)

GET /properties/{key}

  • Return a specific property using it's key

DELETE /properties/{key}

  • Delete a property using it's key

POST /properties?key={key}&value={value}

  • Create a property given a key and value

GET /health

  • Returns a status code of 200 if this service can connect to the database and the internet

Install and Use Pre-commit

Anyone committing to this repo must use the pre-commit hook to lower the likelihood that secrets will be exposed.

Step 1: Install pre-commit

You can install pre-commit using the MacOS package manager Homebrew:

brew install pre-commit

Other installation options can be found in the pre-commit documentation.

Step 2: Install the hooks

Run the following command to install the gitleaks hook:

pre-commit install

This will download and install the pre-commit hooks specified in .pre-commit-config.yaml.

Running the application

This application is a spring boot application which depends on a configurable database connection defined in the application.properties file. This application also uses liquibase to create the tables in the database at startup and provide DB versioning.

To create the spring boot jar:

gradle -b build.gradle bootJar

To execute the jar:

java -jar properties.jar (or whatever the built jar's name is)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published