-
Notifications
You must be signed in to change notification settings - Fork 3
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
[MM-51404]: Added logic to generate unique webhook secret for subscriptions #152
Conversation
… to "Close" on filter popover. (#17) (#21) * [MI-2504][webapp]: Changed Hide to Close on filter popover * [MI-2504][server]: Generated manifest files * [MI-2504][server]: Updated version in manifest Co-authored-by: Abhishek Verma <abhishek.verma@brightscout.com> Co-authored-by: Abhishek Verma <abhishek.verma@brightscout.com>
…API and fixed Boards update subscription. (#22) * [MI-2505][server]: Added logic to protect subscriptions notification webhook API and fixed Boards update subscription. * [MI-2505][MI-2518] Fix failing testcases * [MI-2505]:Added webhook secret encoding and review fixes * [MI-2505]:Added webhook secret encryption * [MI-2505]: Fixed CI * [MI-2505]: Reverted change of auth scopes * [MI-2505]: Fixed CI * [MI-2505][MI-2603] Fixed testcases * [MI-2505]: Used constant for path * [MI-2505]: Refinded message * [MI-2505]: Minor review fixes * [MI-2505][MI-2603] Review fix Co-authored-by: Abhishek Verma <abhishek.verma@brightscout.com> Co-authored-by: raghavaggarwal2308 <raghav.aggarwal@brightscout.com>
* [MI-2877]: Fix for unbounded read in Azure DevOps API client * [MI-2877]: Review fixes --------- Co-authored-by: Abhishek Verma <abhishek.verma@brightscout.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #152 +/- ##
==========================================
- Coverage 65.20% 64.75% -0.45%
==========================================
Files 15 15
Lines 3411 3439 +28
==========================================
+ Hits 2224 2227 +3
- Misses 1040 1065 +25
Partials 147 147
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
Just have a few non-blocking comments. LGTM 👍
server/store/subscriptions.go
Outdated
func (s *Store) GetSubscriptionChannelID(subscriptionID string) (*SubscriptionWebhookSecretAndChannelMap, error) { | ||
var storedWebhookSecret SubscriptionWebhookSecretAndChannelMap | ||
if err := s.LoadJSON(subscriptionID, &storedWebhookSecret); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &storedWebhookSecret, nil | ||
} |
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.
It seems off that the method GetSubscriptionChannelID
is returning something called a webhook secret. The returned value is not a string either, which it seems like secret
would be a string
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.
fixed
|
||
func (s *Store) StoreSubscriptionChannelID(subscriptionID, webhookSecret, channelID string) error { | ||
if err := s.StoreJSON(subscriptionID, SubscriptionWebhookSecretAndChannelMap{ | ||
webhookSecret: channelID, |
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 reads a little weird, because it's not obvious that StoreSubscriptionChannelID
is literally a map, and not a struct with a field named webhookSecret
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.
fixed
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
Added logic to generate unique webhook secret for subscriptions