-
Notifications
You must be signed in to change notification settings - Fork 37
feat: adds RequireFlagsEnabled decorator #1159
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
feat: adds RequireFlagsEnabled decorator #1159
Conversation
I think this is a good idea, and it "feels right" to me ergonomically. Make sure you add something to the test-app to test and document this. |
ca912f0
to
a67cc35
Compare
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 really like the addition!
Added some optional additions to it. Feel free to add them, otherwise we can add them in another PR :)
Thank you!
I will have a look at what is wrong with the e2e test tomorrow @kaushalkapasi :) |
Seems to me like the test-harness git submodule was simply deleted. I've added it back in the latest commit. The e2e tests are working now but you have some small lint errors causing CI failures. |
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 have a couple questions, and one request for an additional test (please let me know if you think this is not necessary) but this looks really cool. Great work!
Happy to approve from my perspective after these are resolved.
aa03a3a
to
ba2c4d6
Compare
Sorry for taking time @kaushalkapasi, many of us have been at KubeCon. |
ba2c4d6
to
f056ae6
Compare
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 would be great if you could also add something to the README to show the feature and explain the usage, so people know it exists and how to use :)
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.
Implementation looks great. Like @lukas-reining says I think we could use some docs so people know how to use this cool new feature... but I'm approving.
…er & endpoint access based on boolean flag values Signed-off-by: Kaushal Kapasi <[email protected]>
…s enabled decorator Signed-off-by: Kaushal Kapasi <[email protected]>
Signed-off-by: Kaushal Kapasi <[email protected]>
…text and allow for flags to change the default value for flag evaluation. move getClientForEvaluation method to utils file Signed-off-by: Kaushal Kapasi <[email protected]>
Signed-off-by: Todd Baert <[email protected]>
Signed-off-by: Kaushal Kapasi <[email protected]>
…add tests with targeting rules defined for the InMemoryProvider Signed-off-by: Kaushal Kapasi <[email protected]>
c7f7d0e
to
a0028a2
Compare
Signed-off-by: Kaushal Kapasi <[email protected]>
… the RequiredFlagsController Signed-off-by: Kaushal Kapasi <[email protected]>
a0028a2
to
2957832
Compare
This PR
RequireFlagsEnabled
decorator to allow a simple, reusable way to block access to a specific controller or endpoint based on the value of a list of one, or many, boolean flagsNotes
Follow-up Tasks
RequireFlagsEnabled
decorator & usage examplesHow to test
npx jest --selectProject=nest