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

refactor: add SecurityRequirement(s) models #588

Merged
merged 5 commits into from
Sep 1, 2022

Conversation

smoya
Copy link
Member

@smoya smoya commented Aug 31, 2022

Description

This PR adds the models for SecurityRequirement and SecurityRequirements based on asyncapi/parser-api#71.

Related issue(s)
#482

}
const scheme = this.createModel(SecurityScheme, securitySchemes[security], { id: security, pointer: `/components/securitySchemes/${security}` });
requirements.push(
this.createModel(SecurityRequirement, scopes, { id: security, scheme: scheme, pointer: `` }) // TODO pointer??
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure which pointer should be here as we don't know if the object is under components or not. cc @magicmatatjahu any idea?

@smoya smoya marked this pull request as draft August 31, 2022 21:40
}
const scheme = this.createModel(SecurityScheme, securitySchemes[security], { id: security, pointer: `/components/securitySchemes/${security}` });
requirements.push(
this.createModel(SecurityRequirement, scopes, { id: security, scheme: scheme, pointer: `` }) // TODO pointer??
Copy link
Member

Choose a reason for hiding this comment

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

Pointer for SecurityRequirement should be as (example):

/channels/{channel}/{operation}/security/{index of requirements}/{security variable - name of security schemes}

Why? Because we point to a single scheme of a single security requirement :) I hope this is clear. Let me know of any misunderstandings!

@smoya smoya changed the title Feat/security requirements refactor: add SecurityRequirement(s) models Sep 1, 2022
@smoya smoya marked this pull request as ready for review September 1, 2022 12:26
Copy link
Member

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

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

Fix only types and rest is good :)

src/models/server.ts Outdated Show resolved Hide resolved
src/models/server.ts Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Sep 1, 2022

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
No Duplication information No Duplication information

Copy link
Member

@magicmatatjahu magicmatatjahu left a comment

Choose a reason for hiding this comment

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

LGTM!

@magicmatatjahu
Copy link
Member

/rtm

@asyncapi-bot asyncapi-bot merged commit cc46e8f into asyncapi:next-major Sep 1, 2022
@smoya smoya deleted the feat/securityRequirements branch September 1, 2022 14:30
magicmatatjahu pushed a commit to magicmatatjahu/parser-js that referenced this pull request Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants