Skip to content

Commit

Permalink
#30 - Move OPA and other configuration options into /sites resource
Browse files Browse the repository at this point in the history
  • Loading branch information
mfriesen committed Mar 15, 2024
1 parent bfbd108 commit 8d54c2e
Show file tree
Hide file tree
Showing 19 changed files with 117 additions and 115 deletions.
20 changes: 10 additions & 10 deletions docs/openapi/openapi-iam.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/fulltextLambdaApi200'
/configuration:
/sites/{siteId}/configuration:
get:
operationId: GetConfiguration
description: Returns the list of sites that the user has access to
summary: Get site configuration
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
"200":
description: 200 OK
Expand Down Expand Up @@ -295,7 +295,7 @@
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -334,15 +334,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/apiKeys:
/sites/{siteId}/apiKeys:
get:
operationId: GetApiKeys
description: Returns the list of ApiKeys
summary: Get API Keys
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
"200":
description: 200 OK
Expand Down Expand Up @@ -371,7 +371,7 @@
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -400,15 +400,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/apiKeys/{apiKey}:
/sites/{siteId}/apiKeys/{apiKey}:
delete:
operationId: DeleteApiKey
description: Adds a new API Key
summary: Delete API Key
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
- $ref: '#/components/parameters/apiKeyParam'
responses:
"200":
Expand All @@ -428,7 +428,7 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/opa:
/sites/opa/accessPolicies:
get:
operationId: GetOpaConfigurations
description: Returns a list of OPA Configuration, can only be requested with ADMIN privileges
Expand Down Expand Up @@ -486,7 +486,7 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/opa/{siteId}:
/sites/{siteId}/opa/accessPolicy:
get:
operationId: GetOpaConfiguration
description: Returns OPA Configuration, can only be requested with ADMIN privileges
Expand Down
20 changes: 10 additions & 10 deletions docs/openapi/openapi-jwt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/fulltextLambdaApi200'
/configuration:
/sites/{siteId}/configuration:
get:
operationId: GetConfiguration
description: Returns the list of sites that the user has access to
summary: Get site configuration
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
"200":
description: 200 OK
Expand Down Expand Up @@ -295,7 +295,7 @@
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -334,15 +334,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/apiKeys:
/sites/{siteId}/apiKeys:
get:
operationId: GetApiKeys
description: Returns the list of ApiKeys
summary: Get API Keys
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
"200":
description: 200 OK
Expand Down Expand Up @@ -371,7 +371,7 @@
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -400,15 +400,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/apiKeys/{apiKey}:
/sites/{siteId}/apiKeys/{apiKey}:
delete:
operationId: DeleteApiKey
description: Adds a new API Key
summary: Delete API Key
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
- $ref: '#/components/parameters/apiKeyParam'
responses:
"200":
Expand All @@ -428,7 +428,7 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/opa:
/sites/opa/accessPolicies:
get:
operationId: GetOpaConfigurations
description: Returns a list of OPA Configuration, can only be requested with ADMIN privileges
Expand Down Expand Up @@ -486,7 +486,7 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/opa/{siteId}:
/sites/{siteId}/opa/accessPolicy:
get:
operationId: GetOpaConfiguration
description: Returns OPA Configuration, can only be requested with ADMIN privileges
Expand Down
20 changes: 10 additions & 10 deletions docs/openapi/openapi-key.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/fulltextLambdaApi200'
/configuration:
/sites/{siteId}/configuration:
get:
operationId: GetConfiguration
description: Returns the list of sites that the user has access to
summary: Get site configuration
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
"200":
description: 200 OK
Expand Down Expand Up @@ -295,7 +295,7 @@
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -334,15 +334,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/apiKeys:
/sites/{siteId}/apiKeys:
get:
operationId: GetApiKeys
description: Returns the list of ApiKeys
summary: Get API Keys
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
"200":
description: 200 OK
Expand Down Expand Up @@ -371,7 +371,7 @@
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -400,15 +400,15 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/apiKeys/{apiKey}:
/sites/{siteId}/apiKeys/{apiKey}:
delete:
operationId: DeleteApiKey
description: Adds a new API Key
summary: Delete API Key
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
- $ref: '#/components/parameters/apiKeyParam'
responses:
"200":
Expand All @@ -428,7 +428,7 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/opa:
/sites/opa/accessPolicies:
get:
operationId: GetOpaConfigurations
description: Returns a list of OPA Configuration, can only be requested with ADMIN privileges
Expand Down Expand Up @@ -486,7 +486,7 @@
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: '#/components/x-amazon-apigateway-integrations/lambdaApi200'
/configuration/opa/{siteId}:
/sites/{siteId}/opa/accessPolicy:
get:
operationId: GetOpaConfiguration
description: Returns OPA Configuration, can only be requested with ADMIN privileges
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private static String getApiKey(final ApiClient client, final String siteId) thr
List<PermissionsEnum> permissions =
Arrays.asList(PermissionsEnum.READ, PermissionsEnum.DELETE, PermissionsEnum.WRITE);
AddApiKeyRequest req = new AddApiKeyRequest().name("My Api Key").permissions(permissions);
String apiKey = api.addApiKey(req, siteId).getApiKey();
String apiKey = api.addApiKey(siteId, req).getApiKey();

apiKeys.put(site, apiKey);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,15 +271,15 @@ Resources:
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: "#/components/x-amazon-apigateway-integrations/fulltextLambdaApi200"
/configuration:
/sites/{siteId}/configuration:
get:
operationId: GetConfiguration
description: Returns the list of sites that the user has access to
summary: Get site configuration
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
'200':
description: "200 OK"
Expand Down Expand Up @@ -308,7 +308,7 @@ Resources:
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -347,15 +347,15 @@ Resources:
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: "#/components/x-amazon-apigateway-integrations/lambdaApi200"
/configuration/apiKeys:
/sites/{siteId}/apiKeys:
get:
operationId: GetApiKeys
description: Returns the list of ApiKeys
summary: Get API Keys
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
responses:
'200':
description: "200 OK"
Expand Down Expand Up @@ -384,7 +384,7 @@ Resources:
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
requestBody:
required: true
content:
Expand Down Expand Up @@ -413,15 +413,15 @@ Resources:
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: "#/components/x-amazon-apigateway-integrations/lambdaApi200"
/configuration/apiKeys/{apiKey}:
/sites/{siteId}/apiKeys/{apiKey}:
delete:
operationId: DeleteApiKey
description: Adds a new API Key
summary: Delete API Key
tags:
- System Management
parameters:
- $ref: '#/components/parameters/siteIdParam'
- $ref: '#/components/parameters/siteIdPathParam'
- $ref: '#/components/parameters/apiKeyParam'
responses:
'200':
Expand All @@ -441,7 +441,7 @@ Resources:
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: "#/components/x-amazon-apigateway-integrations/lambdaApi200"
/configuration/opa:
/sites/opa/accessPolicies:
get:
operationId: GetOpaConfigurations
description: Returns a list of OPA Configuration, can only be requested with ADMIN privileges
Expand Down Expand Up @@ -499,7 +499,7 @@ Resources:
- ApiAuthorization: []
x-amazon-apigateway-integration:
$ref: "#/components/x-amazon-apigateway-integrations/lambdaApi200"
/configuration/opa/{siteId}:
/sites/{siteId}/opa/accessPolicy:
get:
operationId: GetOpaConfiguration
description: Returns OPA Configuration, can only be requested with ADMIN privileges
Expand Down
Loading

0 comments on commit 8d54c2e

Please sign in to comment.