Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
wip: Implementing credential/exporter validation via Hasura Actions (#…
Browse files Browse the repository at this point in the history
…373)

Signed-off-by: Nick Parker <nick@opstrace.com>
  • Loading branch information
Nick Parker committed Feb 23, 2021
1 parent a0f2818 commit daf9343
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 3 deletions.
10 changes: 9 additions & 1 deletion packages/app/docker-compose.yml
Expand Up @@ -47,6 +47,13 @@ services:
HASURA_GRAPHQL_ADMIN_SECRET: myadminsecret
## https://hasura.io/docs/1.0/graphql/core/guides/telemetry.html
HASURA_GRAPHQL_ENABLE_TELEMETRY: "false"
# Config service, validating some GraphQL requests using Hasura Actions
#config:
# image: opstrace/config-api:TODO
# ports:
# - "3000:80"
# environment:
# TODO_SECRET_MAYBE: "123456"
# S3 service for storing modules
s3:
image: minio/minio
Expand All @@ -63,10 +70,11 @@ services:
retries: 3
logging:
driver: none
# TODO is this still used?:
redis:
image: bitnami/redis:6.0.9
environment:
- REDIS_PASSWORD=myredispassword
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL
ports:
- 6379:6379
- 6379:6379
66 changes: 66 additions & 0 deletions packages/app/metadata/actions.graphql
@@ -1,2 +1,68 @@
type Mutation {
CreateCredentials (
tenant: String!
name: String!
type: String!
value: json!
created_at: timestamptz!
updated_at: timestamptz!
): [CreateCredentialsOutput]
}


type Mutation {
CreateExporters (
tenant: String!
name: String!
type: String!
credential: String
config: json!
created_at: timestamptz!
updated_at: timestamptz!
): [CreateExportersOutput]
}


type Mutation {
UpdateCredential (
tenant: String!
name: String!
value: json!
updated_at: timestamptz!
): UpdateCredentialOutput
}


type Mutation {
UpdateExporter (
tenant: String!
name: String!
config: json!
credential: String
updated_at: timestamptz!
): UpdateExporterOutput
}




type UpdateCredentialOutput {
name : String!
tenant : String!
}

type CreateCredentialsOutput {
name : String!
tenant : String!
}

type UpdateExporterOutput {
name : String!
tenant : String!
}

type CreateExportersOutput {
name : String!
tenant : String!
}

32 changes: 30 additions & 2 deletions packages/app/metadata/actions.yaml
@@ -1,6 +1,34 @@
actions: []
actions:
- name: CreateCredentials
definition:
kind: synchronous
handler: http://localhost:3000
permissions:
- role: user_admin
- name: CreateExporters
definition:
kind: synchronous
handler: http://localhost:3000
permissions:
- role: user_admin
- name: UpdateCredential
definition:
kind: synchronous
handler: http://localhost:3000
permissions:
- role: user_admin
- name: UpdateExporter
definition:
kind: synchronous
handler: http://localhost:3000
permissions:
- role: user_admin
custom_types:
enums: []
input_objects: []
objects: []
objects:
- name: UpdateCredentialOutput
- name: CreateCredentialsOutput
- name: UpdateExporterOutput
- name: CreateExportersOutput
scalars: []

0 comments on commit daf9343

Please sign in to comment.