diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml index d4ed3755..f5836d63 100755 --- a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml @@ -490,6 +490,20 @@ paths: items: $ref: "#/components/schemas/Process" + /github-webhook-receive: + post: + operationId: spiffworkflow_backend.routes.process_api_blueprint.github_webhook_receive + summary: receives push webhooks from github so we can keep our process model repo up to date + tags: + - git + responses: + "200": + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/OkTrue" + /process-instances: parameters: - name: process_model_identifier diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index b4437ef8..c58e6d55 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -1816,9 +1816,20 @@ def get_spiff_task_from_process_instance( return spiff_task +# sample body: +# {'ref': 'refs/heads/main', 'repository': {'name': 'sample-process-models', +# 'full_name': 'sartography/sample-process-models', 'private': False .... }} +def github_webhook_receive(body: dict) -> Response: + """Github_webhook_receive.""" + print(f"body: {body}") + return Response(json.dumps({"ok": True}), status=200, mimetype="application/json") + + # # Methods for secrets CRUD - maybe move somewhere else: # + + def get_secret(key: str) -> Optional[str]: """Get_secret.""" return SecretService.get_secret(key) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py index bde40830..511d138e 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/authorization_service.py @@ -232,7 +232,11 @@ class AuthorizationService: def should_disable_auth_for_request(cls) -> bool: """Should_disable_auth_for_request.""" swagger_functions = ["get_json_spec"] - authentication_exclusion_list = ["status", "authentication_callback"] + authentication_exclusion_list = [ + "status", + "authentication_callback", + "github_webhook_receive", + ] if request.method == "OPTIONS": return True