MCPcopy Create free account
hub / github.com/StackStorm/st2 / get_one

Method get_one

st2api/st2api/controllers/v1/webhooks.py:108–124  ·  view source on GitHub ↗
(self, url, requester_user)

Source from the content-addressed store, hash-verified

106 return self._hooks.get_all()
107
108 def get_one(self, url, requester_user):
109 triggers = self._hooks.get_triggers_for_hook(url)
110
111 if not triggers:
112 abort(http_client.NOT_FOUND)
113 return
114
115 permission_type = PermissionType.WEBHOOK_VIEW
116 rbac_utils = get_rbac_backend().get_utils_class()
117 rbac_utils.assert_user_has_resource_db_permission(
118 user_db=requester_user,
119 resource_db=WebhookDB(name=url),
120 permission_type=permission_type,
121 )
122
123 # For demonstration purpose return 1st
124 return triggers[0]
125
126 def post(self, hook, webhook_body_api, headers, requester_user):
127 body = webhook_body_api.data

Callers

nothing calls this directly

Calls 6

abortFunction · 0.90
get_rbac_backendFunction · 0.90
WebhookDBClass · 0.90
get_triggers_for_hookMethod · 0.80
get_utils_classMethod · 0.45

Tested by

no test coverage detected