Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api/GovStack Consent BB API endpoints - endpoints.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ API tag: config,,,,,,,,,,,,,
CRUDL for Policy object,,,,,,,,,,,,,
/config/policy/,POST,UC-C-PIC-A-001,,,Policy*,"Policy, Revision",CREATE - Creates a new Policy object and returns the new object and a PolicyRevision,FALSE,,configPolicyCreate,"A set consisting of the new Policy object created, together with the initial Revision object.",org,Policy
/config/policy/{policyId}/,GET,UC-C-PIC-A-003,,revisionId,,"Policy, Revision",READ - get a Policy object + latest Revisio,FALSE,,configPolicyRead,,org,Policy
/config/policy/{policyId}/revisions/,GET,UC-C-PIC-A-003,,,,Policy,LIST - returns the current Policy,FALSE,,configPolicyRevisionsList,,org,Revision
/config/policy/{policyId}/revisions/,GET,UC-C-PIC-A-003,,,,revisions:Revision<List>,LIST - returns all revisions of a Policy,FALSE,,configPolicyRevisionsList,,org,Revision
/config/policy/{policyId}/,PUT,UC-C-PIC-A-002,,,Policy*,"Policy, Revision","UPDATE - Updates an existing Policy object, returning the updated version and a new revision. Updating a Policy must not affect existing active references in DataAgreement, the new Revision should be specified for Agreement.",FALSE,,configPolicyUpdate,,org,Policy
/config/policy/{policyId}/,DELETE,UC-C-PIC-A-004,,,,Revision,"DELETE - Deletes an existing Policy object, returning a new revision. Deleting a Policy is not possible if it's associated with active DataAgreement.",FALSE,,configPolicyDelete,,org,Policy
/config/policies/,GET,"UC-C-PIC-A-001, UC-C-PIC-A-002",,revisionId,,policies:Policy<List>,LIST - Fetches list of readable Policy objects,FALSE,Returns a list of readable Policy objects,configPolicyList,A list of Policy objects readable for the current session's credentials.,admin,Policy
Expand All @@ -18,11 +18,11 @@ CRUDL for DataAgreement object,,,,,,,,FALSE,,,,org,
/config/individual/{individualId}/,GET,,,,,Individual,READ - Fetch an Individual in the Consent system,TRUE,,configIndividualRead,,org,Individual
/config/individuals/,GET,,,,,individuals:Individual<List>,LIST - lists individuals in the system,TRUE,,configIndividualList,,org,Individual
"CRUDL for ""Webhook"" object",,,,,,,,FALSE,,,,,
/config/webhook/,POST,,,,Webhook*,Webhook,CREATE - Creates a new Webhook object and returns the new object,FALSE,,configWebhookCreate,"A set consisting of the new Webhook object created, together with the initial Revision object.",admin,Webhook
/config/webhook/{webhookId}/,GET,,,revisionId,,Webhook,READ - get a Webhook object.,FALSE,,configWebhookRead,,admin,Webhook
/config/webhook/,POST,,,,Webhook*,Webhook,CREATE - Creates a new Webhook object and returns the new object,FALSE,,configWebhookCreate,Returns the new Webhook object created,admin,Webhook
/config/webhook/{webhookId}/,GET,,,,,Webhook,READ - get a Webhook object.,FALSE,,configWebhookRead,,admin,Webhook
/config/webhook/{webhookId}/,PUT,,,,Webhook*,Webhook,"UPDATE - Updates an existing Webhook object, returning the updated version.",FALSE,,configWebhookUpdate,,admin,Webhook
/config/webhook/{webhookId}/,DELETE,,,,,,DELETE - Deletes an existing Webhook object.,FALSE,,configWebhookDelete,,admin,Webhook
/config/webhooks/,GET,,,revisionId,,webhooks:Webhook<List>,LIST - Fetches list of readable Webhook objects,FALSE,Returns a list of readable Webhook objects,configWebhookList,A list of Webhook objects readable for the current session's credentials.,admin,Webhook
/config/webhooks/,GET,,,,,webhooks:Webhook<List>,LIST - Fetches list of readable Webhook objects,FALSE,Returns a list of readable Webhook objects,configWebhookList,A list of Webhook objects readable for the current session's credentials.,admin,Webhook
,,,,,,,,FALSE,,,,,
API tag: service,,,,,,,,,,,,,
"CRUDL for ""Individual"" object",,,,,,,,TRUE,,,,org,Individual
Expand Down
27 changes: 8 additions & 19 deletions api/consent-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ paths:
get:
tags:
- config
summary: "LIST - returns the current Policy"
summary: "LIST - returns all revisions of a Policy"
operationId: "configPolicyRevisionsList"
description: "LIST - returns the current Policy"
description: "LIST - returns all revisions of a Policy"
parameters:
- in: path
name: "policyId"
Expand Down Expand Up @@ -254,8 +254,11 @@ paths:
schema:
type: object
properties:
policy:
$ref: '#/components/schemas/Policy'
revisions:
type: array
items:
oneOf:
- $ref: '#/components/schemas/Revision'

'400':
description: bad input parameter
Expand Down Expand Up @@ -700,7 +703,7 @@ paths:
x-specification-crudl-model: "Webhook"
responses:
'200':
description: "A set consisting of the new Webhook object created, together with the initial Revision object."
description: "Returns the new Webhook object created"

content:
application/json:
Expand Down Expand Up @@ -748,13 +751,6 @@ paths:
schema:
type: string

- in: query
name: revisionId
description: "An object with id revisionId"
required: false
schema:
type: string

x-specification-usecase: ""
x-specification-scenario: ""
x-specification-pii-or-sensitive: "False"
Expand Down Expand Up @@ -868,13 +864,6 @@ paths:
operationId: "configWebhookList"
description: "LIST - Fetches list of readable Webhook objects"
parameters:
- in: query
name: revisionId
description: "An object with id revisionId"
required: false
schema:
type: string

- in: query
name: "offset"
description: "Requested index for start of resources to be provided in response requested by client"
Expand Down
10 changes: 5 additions & 5 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ then
docker build . -t test:latest
cd -
cd ./examples/mock/
docker-compose build
docker compose build
cd -
exit
fi
Expand All @@ -71,13 +71,13 @@ cd ./examples/mock/

if [ "$1" == "fixtures" ]
then
docker-compose exec -it consent python manage.py dumpdata app --indent 2 > ./djangoapp/fixtures.json
docker compose exec -it consent python manage.py dumpdata app --indent 2 > ./djangoapp/fixtures.json
exit 0
fi

if [ "$1" == "test" ]
then
docker-compose up -d
docker compose up -d
else

echo ""
Expand All @@ -88,7 +88,7 @@ else
echo "https://localhost:8888 (HTTPS)"
echo "http://localhost:8000 (Django mock application direct access)"

docker-compose up --build
docker compose up --build
fi
cd -

Expand All @@ -102,7 +102,7 @@ then

cd ./examples/mock/

docker-compose stop
docker compose stop

cd -
fi
Expand Down
8 changes: 4 additions & 4 deletions examples/mock/djangoapp/consentbb/app/api_autogenerated.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def config_policy_delete(request, policyId: str):
def config_policy_revisions_list(request, policyId: str, offset: int=None, limit: int=None):
db_instance = get_object_or_404(models.Revision, pk=policyId)
return {
"policy": schemas.RevisionSchema.from_orm(db_instance).dict()
"revisions": schemas.RevisionSchema.from_orm(db_instance).dict()
}


Expand Down Expand Up @@ -147,7 +147,7 @@ def config_webhook_create(request, webhook: schemas.WebhookSchema):


@api.get("/config/webhook/{webhookId}/")
def config_webhook_read(request, webhookId: str, revisionId: str=None):
def config_webhook_read(request, webhookId: str):
db_instance = get_object_or_404(models.Webhook, pk=webhookId)
return {
"webhook": schemas.WebhookSchema.from_orm(db_instance).dict()
Expand All @@ -168,8 +168,8 @@ def config_webhook_delete(request, webhookId: str):


@api.get("/config/webhooks/")
def config_webhook_list(request, revisionId: str=None, offset: int=None, limit: int=None):
db_instance = get_object_or_404(models.Webhook, pk=revisionId)
def config_webhook_list(request, offset: int=None, limit: int=None):
db_instance = get_object_or_404(models.Webhook, pk=None)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something phishy here, a list isn't returned

return {
"webhooks": schemas.WebhookSchema.from_orm(db_instance).dict()
}
Expand Down