-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Api Key not being sent when deleting webhook #3678
Comments
securityDefinitions:
API Key:
type: apiKey
in: header
name: X-Api-Key
security:
- API Key: [] |
I can paste the whole connector if needed. |
Can you tell me how you are getting that Location URL? |
Oh sorry, this is a specific URL generated by the Apiary inspector: |
I've sent an email to Everhour - if we get the respond to URL figured out, then this should work and I don't think you need to add the location. |
What do you mean the respond url? It is always |
I actually don't do this and it is working nonetheless. I assumed it was some sort of standard and you took care of it. I register hooks alright, I just can't get them to unregister. Here is the whole connector: {
"swagger": "2.0",
"info": {
"title": "Everhour",
"description": "",
"version": "1.0"
},
"host": "api.everhour.com",
"basePath": "/",
"schemes": [
"https"
],
"consumes": [],
"produces": [],
"paths": {
"/projects": {
"get": {
"responses": {
"default": {
"description": "default",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Project"
}
}
}
},
"summary": "Get projects",
"description": "Gets the project list",
"operationId": "GetProjects",
"parameters": [
{
"$ref": "#/parameters/Content-type"
},
{
"name": "limit",
"in": "query",
"required": false,
"type": "integer"
},
{
"name": "query",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "platform",
"in": "query",
"required": false,
"type": "string",
"enum": [
"as",
"ev",
"b3",
"b2",
"pv",
"gh",
"in",
"tr",
"jr"
]
}
]
}
},
"/hooks": {
"x-ms-notification-content": {
"description": "Default response",
"schema": {}
},
"post": {
"responses": {
"201": {
"description": "Default"
}
},
"summary": "Triggers",
"operationId": "Trigger",
"x-ms-trigger": "single",
"parameters": [
{
"$ref": "#/parameters/Content-type"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"targetUrl": {
"type": "string",
"description": "targetUrl",
"x-ms-notification-url": true,
"x-ms-visibility": "internal",
"title": ""
},
"events": {
"type": "array",
"items": {
"type": "string"
},
"description": "events"
},
"project": {
"type": "string",
"description": "project"
}
},
"required": [
"targetUrl"
]
}
}
],
"description": "Any trigger"
}
},
"/hooks/{hook_id}": {
"delete": {
"responses": {
"204": {
"description": "Success",
"schema": {}
}
},
"summary": "Delete a Webhook",
"description": "Deletes a webhook given an id",
"operationId": "DeleteWebhook",
"x-ms-visibility": "internal",
"parameters": [
{
"$ref": "#/parameters/Content-type"
},
{
"name": "hook_id",
"in": "path",
"required": true,
"type": "integer"
},
{
"name": "X-My-Header",
"in": "header",
"type": "string",
"default": "My value"
}
]
},
"get": {
"responses": {
"default": {
"description": "default",
"schema": {
"$ref": "#/definitions/Hook"
}
}
},
"summary": "Get webhook",
"description": "Gets a webhook by id",
"operationId": "GetWebhook",
"parameters": [
{
"$ref": "#/parameters/Content-type"
},
{
"name": "hook_id",
"in": "path",
"required": true,
"type": "string"
}
]
}
}
},
"definitions": {
"Hook": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"description": "id"
},
"targetUrl": {
"type": "string",
"description": "targetUrl"
},
"events": {
"type": "array",
"items": {
"type": "string"
},
"description": "events"
},
"project": {
"type": "string",
"description": "project"
},
"isActive": {
"type": "boolean",
"description": "isActive"
},
"createdAt": {
"type": "string",
"description": "createdAt"
},
"lastUsedAt": {
"type": "string",
"description": "lastUsedAt"
}
}
},
"Project": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "id"
},
"name": {
"type": "string",
"description": "name"
},
"workspaceId": {
"type": "string",
"description": "workspaceId"
},
"workspaceName": {
"type": "string",
"description": "workspaceName"
},
"client": {
"type": "integer",
"format": "int32",
"description": "client"
},
"type": {
"type": "string",
"description": "type"
},
"favorite": {
"type": "boolean",
"description": "favorite"
},
"users": {
"type": "array",
"items": {
"type": "integer",
"format": "int32"
},
"description": "users"
},
"billing": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "type"
},
"fee": {
"type": "integer",
"format": "int32",
"description": "fee"
}
},
"description": "billing"
},
"rate": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "type"
},
"rate": {
"type": "integer",
"format": "int32",
"description": "rate"
},
"userRateOverrides": {
"type": "object",
"properties": {},
"description": "userRateOverrides"
},
"userCostOverrides": {
"type": "object",
"properties": {},
"description": "userCostOverrides"
}
},
"description": "rate"
},
"budget": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "type"
},
"budget": {
"type": "integer",
"format": "int32",
"description": "budget"
},
"progress": {
"type": "integer",
"format": "int32",
"description": "progress"
},
"timeProgress": {
"type": "integer",
"format": "int32",
"description": "timeProgress"
},
"expenseProgress": {
"type": "integer",
"format": "int32",
"description": "expenseProgress"
},
"period": {
"type": "string",
"description": "period"
},
"appliedFrom": {
"type": "string",
"description": "appliedFrom"
},
"disallowOverbudget": {
"type": "boolean",
"description": "disallowOverbudget"
},
"excludeUnbillableTime": {
"type": "boolean",
"description": "excludeUnbillableTime"
},
"excludeExpenses": {
"type": "boolean",
"description": "excludeExpenses"
},
"showToUsers": {
"type": "boolean",
"description": "showToUsers"
},
"threshold": {
"type": "integer",
"format": "int32",
"description": "threshold"
}
},
"description": "budget"
}
}
}
},
"parameters": {
"Content-type": {
"name": "Content-type",
"in": "header",
"type": "string",
"default": "application/json"
}
},
"responses": {},
"securityDefinitions": {
"API Key": {
"type": "apiKey",
"in": "header",
"name": "X-Api-Key"
}
},
"security": [
{
"API Key": []
}
],
"tags": []
} |
I’m not sure why the custom code is needed then. If the location is a static URL, you could return it with a policy. |
It's not static. I get the id from the response of the hook registration. |
I am not sure how to do that. Can you explain what you mean? |
In fact, I am new to connectors and while I beginning to get it, policies are still a blur to me :-) I will dig in the documentation, but it will certainly help if you can give an example of what you mean. I am switching to |
I think I understood it. Like: {
"templateId": "setheader",
"title": "Set Location for webhook response",
"parameters": {
"x-ms-apimTemplateParameter.name": "Location",
"x-ms-apimTemplateParameter.value": "https://api.everhour.com/hooks/{@body().id}",
"x-ms-apimTemplate-policySection": "Response"
}
}, Am I correct? |
Type of Connector
Custom Connector
Name of Connector
Everhour
Describe the bug
I have create a custom connector for Everhour. It works fine, but they don't include the
Location
header in their response to the request creating the webhook. So I added custom code to my connector adding the header:So now the connector runs that URL when the flow is turned off. The problem is that no authentication headers are sent. The delete action is defined in the connector, but the deletion seems to ignore the definition (you can see I even added a random header just to make sure it is sent, but it isn't):
I'd appreciate any help here. I know what the headers are not sent, because their API offers a mock address that displays the calls. The delete call looks like this:
The operation "Trigger" definition is:
Is this a security bug?
No, this is not a security bug
What is the severity of this bug?
Severity 2 - One or more important connector features are down
To Reproduce
Turn off the flow using the connector.
Expected behavior
The authentication header is sent with the delete requests.
Environment summary
Web.
Additional context
No additional context.
The text was updated successfully, but these errors were encountered: