Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
README.md 11.34 KiB

os-legal-azure

os-legal-azure is a Spring Boot service that hosts CRUD APIs that enable management of legal tags within the OSDU R2 ecosystem.

Running Locally

Requirements

In order to run this service locally, you will need the following:

General Tips

Environment Variable Management The following tools make environment variable configuration simpler

Lombok This project uses Lombok for code generation. You may need to configure your IDE to take advantage of this tool.

Environment Variables

In order to run the service locally, you will need to have the following environment variables defined.

Note The following command can be useful to pull secrets from keyvault:

az keyvault secret show --vault-name $KEY_VAULT_NAME --name $KEY_VAULT_SECRET_NAME --query value -otsv

Required to run service

name value description sensitive? source
LOG_PREFIX legal Logging prefix no -
server.servlet.contextPath /api/legal/v1/ Servlet context path no -
legal_service_region us Legal service region no -
entitlements_service_endpoint ex https://foo-entitlements.azurewebsites.net Entitlements API endpoint no output of infrastructure deployment
entitlements_service_api_key ******** The API key clients will need to use when calling the service yes --
partition_service_endpoint ex https://foo-partition.azurewebsites.net Partition Service API endpoint no output of infrastructure deployment
azure.activedirectory.app-resource-id ******** AAD client application ID yes output of infrastructure deployment
LEGAL_HOSTNAME notused Possibly unused no -
CRON_JOB_IP 10.0.0.1 Possibly unused no -
azure.activedirectory.session-stateless true Flag run in stateless mode (needed by AAD dependency) no --
aad_client_id ******** AAD client application ID yes output of infrastructure deployment
azure.activedirectory.AppIdUri api://${azure.activedirectory.client-id} URI for AAD Application no --
cosmosdb_database ex dev-osdu-r2-db Cosmos database for legal documents no output of infrastructure deployment
azure.storage.container-name ex legal-service-azure-configuration Storage container for legal documents no output of infrastructure deployment
azure.storage.enable-https true Spring configuration for Azure Storage no -
servicebus_topic_name legaltags Topic for async messaging no output of infrastructure deployment
KEYVAULT_URI ex https://foo-keyvault.vault.azure.net/ URI of KeyVault that holds application secrets no output of infrastructure deployment
AZURE_CLIENT_ID ******** Identity to run the service locally. This enables access to Azure resources. You only need this if running locally yes keyvault secret: $KEYVAULT_URI/secrets/app-dev-sp-username
AZURE_TENANT_ID ******** AD tenant to authenticate users from yes keyvault secret: $KEYVAULT_URI/secrets/app-dev-sp-tenant-id
AZURE_CLIENT_SECRET ******** Secret for $AZURE_CLIENT_ID yes keyvault secret: $KEYVAULT_URI/secrets/app-dev-sp-password
appinsights_key ******** API Key for App Insights yes output of infrastructure deployment
azure_istioauth_enabled true Flag to Disable AAD auth no --

Required to run integration tests

name value description sensitive? source
INTEGRATION_TESTER ******** System identity to assume for API calls. Note: this user must have entitlements configured already no --
MY_TENANT ex opendes OSDU tenant used for testing no --
AZURE_TESTER_SERVICEPRINCIPAL_SECRET ******** Secret for $INTEGRATION_TESTER yes --
AZURE_AD_TENANT_ID ******** AD tenant to authenticate users from yes --
AZURE_AD_APP_RESOURCE_ID ******** AAD client application ID yes output of infrastructure deployment
AZURE_LEGAL_STORAGE_ACCOUNT same as storage_account above Storage account for integration tests no -
AZURE_LEGAL_STORAGE_KEY ******** Storage account key yes output of infrastructure deployment
AZURE_LEGAL_SERVICEBUS ******** Servicebus namespace connection string yes output of infrastructure deployment
AZURE_LEGAL_TOPICNAME legaltags Same as servicebus_topic_name above no -
HOST_URL http://localhost:8080/ local service endpoint no -
ENTITLEMENT_URL Same as entitlements_service_endpoint above Endpoint for entitlements URL no -

Configure Maven