-
Notifications
You must be signed in to change notification settings - Fork 133
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
Add support for Azure EventHub provider #191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments 👍😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor tweaks
} | ||
|
||
// Post all notification-controller messages to EventHub | ||
func (e *AzureEventHub) Post(event events.Event) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really matter, but maybe change the variable from e
to a
Solves #190 Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
* Update go.sum * Use ctx with timeout * minor linting & clean-up Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
Depending if endpointURL starts with Endpoint or not we assume that it's a JWT token or not. Making sure that the JWT token is up to date is NOT the notifcation-controllers work Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
For JWT * channel = eventhub namespace * address = eventhub name * token = jwt token For SAS * address = connectionString, including endpoint tokens etc Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
@NissesSenap please run |
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
* Add secret example for SAS and JWT Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
* Change name of var eventhubNamespace to eventhubNamespace Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
export AZURE_SECRET='secret-client-secret-generated-at-creation' | ||
export AZURE_TENANT=$(az account show -o tsv --query tenantId) | ||
|
||
curl -X GET --data 'grant_type=client_credentials' --data "client_id=$AZURE_CLIENT" --data "client_secret=$AZURE_SECRET" --data 'resource=https://eventhubs.azure.net' -H 'Content-Type: application/x-www-form-urlencoded' https://login.microsoftonline.com/$AZURE_TENANT/oauth2/token |jq .access_token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will use your account instead of the application account. Risk of giving to much access, I would recomend to use this way.
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🌹
Solves #190