Skip to content

Commit

Permalink
Feature: Plan import (#97)
Browse files Browse the repository at this point in the history
* add support for plan import

* fix doc

* add activity tag creation to plan import
add simulation args to plan import

* fix doc typo

* fix swagger typo

* update env template

* send error code on import failure
  • Loading branch information
duranb authored Jul 24, 2024
1 parent 95886d9 commit 9735093
Show file tree
Hide file tree
Showing 14 changed files with 937 additions and 31 deletions.
6 changes: 6 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
GATEWAY_DB_USER=
GATEWAY_DB_PASSWORD=

HASURA_API_URL=http://localhost:8080

HASURA_GRAPHQL_JWT_SECRET=
14 changes: 3 additions & 11 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
module.exports = {
ignorePatterns: ["static/*"],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
ignorePatterns: ['static/*'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
Expand All @@ -16,10 +12,6 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'no-undef': 'off',
'sort-keys': [
'error',
'asc',
{ caseSensitive: true, minKeys: 2, natural: false },
],
'sort-keys': ['error', 'asc', { caseSensitive: true, minKeys: 2, natural: false }],
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
dist
files/*
node_modules
.env
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ The API gateway for [Aerie](https://github.com/NASA-AMMOS/aerie).

## Develop

First make sure you have [Node.js LTS](https://nodejs.org) installed. Set the default `POSTGRES_USER` and `POSTGRES_PASSWORD` [environment variables](./docs/ENVIRONMENT.md), then do:
First make sure you have [Node.js LTS](https://nodejs.org) installed.

If you are doing active local development outside of a container, duplicate the `.env.template` and rename it to `.env`. Set the default `GATEWAY_DB_USER`, `GATEWAY_DB_PASSWORD`, and `HASURA_GRAPHQL_JWT_SECRET` [environment variables](./docs/ENVIRONMENT.md).
If your Hasura instance is not hosted on `http://localhost:8080`, update the value of `HASURA_API_URL` in the `.env` as well. Afterwards, run the following:

```sh
npm install
npm run dev
```

This will watch for code changes and rebuild and restart the gateway server automatically.

If you are running Aerie Gateway within a container (i.e. the docker-compose from the main Aerie repo), run the following before starting the container:

```sh
npm install
Expand All @@ -22,4 +34,3 @@ npm start
## License

The scripts and documentation in this project are released under the [MIT License](LICENSE).

4 changes: 2 additions & 2 deletions docs/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This document provides detailed information about environment variables for the gateway.

| Name | Description | Type | Default |
|-----------------------------|------------------------------------------------------------------------------------------------------|----------|------------------------------------------------|
| --------------------------- | ---------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------- |
| `ALLOWED_ROLES` | Allowed roles when authentication is enabled. | `array` | ["user", "viewer"] |
| `ALLOWED_ROLES_NO_AUTH` | Allowed roles when authentication is disabled. | `array` | ["aerie_admin", "user", "viewer"] |
| `AUTH_GROUP_ROLE_MAPPINGS` | JSON object that maps auth provider groups to Aerie roles. See [SSO authentication docs][SSO authn] | `JSON` | {} |
Expand All @@ -15,7 +15,7 @@ This document provides detailed information about environment variables for the
| `DEFAULT_ROLE_NO_AUTH` | Default role when authentication is disabled. | `string` | aerie_admin |
| `GQL_API_URL` | URL of GraphQL API for the GraphQL Playground. | `string` | http://localhost:8080/v1/graphql |
| `GQL_API_WS_URL` | URL of GraphQL WebSocket API for the GraphQL Playground. | `string` | ws://localhost:8080/v1/graphql |
| `HASURA_METADATA_API_URL` | URL of Hasura Metadata API. | `string` | http://hasura:8080/v1/metadata |
| `HASURA_API_URL` | URL of Hasura APIs. | `string` | http://hasura:8080/ |
| `HASURA_GRAPHQL_JWT_SECRET` | The JWT secret. Also in Hasura. **Required** even if auth off in Hasura. | `string` | |
| `JWT_ALGORITHMS` | List of [JWT signing algorithms][algorithms]. Must include algorithm in `HASURA_GRAPHQL_JWT_SECRET`. | `array` | ["HS256"] |
| `JWT_EXPIRATION` | Amount of time until JWT expires. | `string` | 36h |
Expand Down
Loading

0 comments on commit 9735093

Please sign in to comment.