-
Notifications
You must be signed in to change notification settings - Fork 169
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(3266): add authn for banner list and get endpoints #3278
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Dayanand Sagar <[email protected]>
Co-authored-by: Dayanand Sagar <[email protected]>
plugins/banners/get.js
Outdated
@@ -13,6 +13,10 @@ module.exports = () => ({ | |||
description: 'Get a single banner', | |||
notes: 'Return a banner record', | |||
tags: ['api', 'banners'], | |||
auth: { | |||
strategies: ['token'], | |||
scope: ['user'] |
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.
Banners with GLOBAL
scope are currently being fetched without the user being authenticated.
This change makes it backward incompatible. We are unable fetch 'GLOBAL' banners when the user is not authenticated.
Auth check may need to be done selectively based on the scope. GLOBAL
can be accessed by anyone like before. But, PIPELINE
should be accessed by a user with valid token.
Context
The current banner endpoints for list and get do not require user authentication, which is unintended behavior.
Objective
The change aims to enforce token-based authentication for both API endpoints.
References
#3266
License
I confirm that this contribution is made under a BSD license and that I have the authority necessary to make this contribution on behalf of its copyright owner.