Skip to content

feature/665 - Add NoSecurity decorator#684

Merged
WoH merged 2 commits intolukeautry:masterfrom
picturelink:feature/665
May 7, 2020
Merged

feature/665 - Add NoSecurity decorator#684
WoH merged 2 commits intolukeautry:masterfrom
picturelink:feature/665

Conversation

@picturelink
Copy link
Contributor

@picturelink picturelink commented May 6, 2020

Resolves feature request #665 by adding a NoSecurity decorator that can be used to override the Security decorator on a class.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you written unit tests?
  • Have you written unit tests that cover the negative cases (i.e.: if bad data is submitted, does the library respond properly)?
  • This PR is associated with an existing issue?

Closing issues

Put closes #XXXX (where XXXX is the issue number) in your comment to auto-close the issue that your PR fixes.

If this is a new feature submission:

  • Has the issue had a maintainer respond to the issue and clarify that the feature is something that aligns with the goals and philosophy of the project?

Potential Problems With The Approach

The noSecurityDecorators variable name could be seen as a little ambiguous, but is not publicly visible.

Test plan

Tests will be added once the maintainers are happy with my approach in the PR (and I get to grips with these unit tests). Ones I can think of are:

  • MethodGenerator.getSecurity returns empty array when NoSecurity decorator is used.

I can't seem to find any way of testing invalid decorator usage, but have verified that the following errors are thrown as expected.

  • ControllerGenerator.getSecurity throws when a NoSecurity decorator is used.
  • MethodGenerator.getSecurity throws when multiple NoSecurity decorators are used.
  • MethodGenerator.getSecurity throws when NoSecurity and Security decorators are used.

Resolves feature request lukeautry#665 by adding a NoSecurity decorator that can
be used to override the Security decorator on a class.
@WoH WoH linked an issue May 6, 2020 that may be closed by this pull request
4 tasks
@WoH
Copy link
Collaborator

WoH commented May 7, 2020

LGTM, thanks a lot!

@WoH WoH merged commit 337e847 into lukeautry:master May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add decorator to specify Anonymous access to a controller method

2 participants