add skeleton of endpoint to receive github webhooks
This commit is contained in:
parent
2ad4da8fb9
commit
f38af7f4a4
|
@ -490,6 +490,20 @@ paths:
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/Process"
|
$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:
|
/process-instances:
|
||||||
parameters:
|
parameters:
|
||||||
- name: process_model_identifier
|
- name: process_model_identifier
|
||||||
|
|
|
@ -1816,9 +1816,20 @@ def get_spiff_task_from_process_instance(
|
||||||
return spiff_task
|
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:
|
# Methods for secrets CRUD - maybe move somewhere else:
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
def get_secret(key: str) -> Optional[str]:
|
def get_secret(key: str) -> Optional[str]:
|
||||||
"""Get_secret."""
|
"""Get_secret."""
|
||||||
return SecretService.get_secret(key)
|
return SecretService.get_secret(key)
|
||||||
|
|
|
@ -232,7 +232,11 @@ class AuthorizationService:
|
||||||
def should_disable_auth_for_request(cls) -> bool:
|
def should_disable_auth_for_request(cls) -> bool:
|
||||||
"""Should_disable_auth_for_request."""
|
"""Should_disable_auth_for_request."""
|
||||||
swagger_functions = ["get_json_spec"]
|
swagger_functions = ["get_json_spec"]
|
||||||
authentication_exclusion_list = ["status", "authentication_callback"]
|
authentication_exclusion_list = [
|
||||||
|
"status",
|
||||||
|
"authentication_callback",
|
||||||
|
"github_webhook_receive",
|
||||||
|
]
|
||||||
if request.method == "OPTIONS":
|
if request.method == "OPTIONS":
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue