Skip to content
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(core): add permission specifying decorators #28

Merged
merged 2 commits into from
Oct 22, 2021
Merged

Conversation

akshatdubeysf
Copy link
Contributor

Description

Add decorators that describe the required permissions in the OpenAPI specifications.

Fixes #27

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Intermediate change (work in progress)

Checklist:

  • Performed a self-review of my own code
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Any dependent changes have been merged and published in downstream modules

README.md Outdated
these decorators are an extended version of the loopback operation decorators - `get`, `post`, `put`, `patch` and `del` respectively, with an extra parameter for authorization metadata. These decorators have an added benefit of specifying the required permissions in the OpenAPI description of the endpoints.

```ts
authorizedPost(rolesPath, {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be an additional decorator rather than overriding the existing one ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, added a new decorator - authorizeWithSpecs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, readme changes also removed as they are no longer required.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@samarpan-b samarpan-b merged commit 6878d77 into master Oct 22, 2021
@samarpan-b samarpan-b deleted the GH-27 branch October 22, 2021 08:50
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 for permissions description in OpenAPI specs
3 participants