-
Notifications
You must be signed in to change notification settings - Fork 281
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
fix: [botframework-connector] Use HashSet instead of string array for endorsement #4526
Conversation
@microsoft-github-policy-service agree |
@@ -25,14 +25,14 @@ export class EndorsementsValidator { | |||
* some specific channels. That list is the endorsement list, and is validated here against the channelId. | |||
* @returns {boolean} True is the channelId is found in the Endorsement set. False if the channelId is not found. | |||
*/ | |||
static validate(channelId: string, endorsements: string[]): boolean { | |||
static validate(channelId: string, endorsements: Set<string>): boolean { |
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.
Changing the function's signature would break the backward compat. Instead, could you create a new function that receives the Set argument and call it inside the old validate function?
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.
I'm not opposed to breaking this if having another method is clutter. Is there harm in having two?
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.
I suggest a private function to be called inside this old one (passing the converted strings[] as set) so those who are using this with an array won't experience a break.
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.
Sounds good, probably with a comment about it. Future refactor I suppose if we ever do another major release. v5.
Pull Request Test Coverage Report for Build 7522268835
💛 - Coveralls |
@ceciliaavila When you get a chance can you please run |
Fixes #4454
#minor
Description
This small PR just changes an argument type in the static validate method of the EndorsementsValidator class.
Specific Changes
Testing
All unit tests passed