add skeleton of endpoint to receive github webhooks
This commit is contained in:
parent
7b9e99ad96
commit
aa6fe82864
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue