diff --git a/api/GovStack Consent BB API endpoints - endpoints.csv b/api/GovStack Consent BB API endpoints - endpoints.csv index 72dff42..c5d9b30 100644 --- a/api/GovStack Consent BB API endpoints - endpoints.csv +++ b/api/GovStack Consent BB API endpoints - endpoints.csv @@ -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 - 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 - 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 @@ -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 - 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 - 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 - 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 diff --git a/api/consent-openapi.yaml b/api/consent-openapi.yaml index a65e280..da8787d 100644 --- a/api/consent-openapi.yaml +++ b/api/consent-openapi.yaml @@ -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" @@ -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 @@ -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: @@ -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" @@ -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" diff --git a/dev.sh b/dev.sh index 6d57ded..62471e9 100755 --- a/dev.sh +++ b/dev.sh @@ -62,7 +62,7 @@ then docker build . -t test:latest cd - cd ./examples/mock/ - docker-compose build + docker compose build cd - exit fi @@ -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 "" @@ -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 - @@ -102,7 +102,7 @@ then cd ./examples/mock/ - docker-compose stop + docker compose stop cd - fi diff --git a/examples/mock/djangoapp/consentbb/app/api_autogenerated.py b/examples/mock/djangoapp/consentbb/app/api_autogenerated.py index 923b67a..63dd0bb 100644 --- a/examples/mock/djangoapp/consentbb/app/api_autogenerated.py +++ b/examples/mock/djangoapp/consentbb/app/api_autogenerated.py @@ -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() } @@ -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() @@ -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) return { "webhooks": schemas.WebhookSchema.from_orm(db_instance).dict() }