-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ns-openapi-3-1): add support for Security Scheme Object
- Loading branch information
Showing
18 changed files
with
183 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
apidom/packages/apidom-ns-openapi-3-1/src/elements/SecurityScheme.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import { Attributes, Meta } from 'minim'; | ||
import { ObjectElement, StringElement } from 'apidom'; | ||
|
||
import OAuthFlowsElement from './OAuthFlows'; | ||
|
||
class SecurityScheme extends ObjectElement { | ||
constructor(content?: Record<string, unknown>, meta?: Meta, attributes?: Attributes) { | ||
super(content, meta, attributes); | ||
this.element = 'securityScheme'; | ||
} | ||
|
||
get type(): StringElement { | ||
return this.get('type'); | ||
} | ||
|
||
set type(type: StringElement) { | ||
this.set('type', type); | ||
} | ||
|
||
get description(): StringElement { | ||
return this.get('description'); | ||
} | ||
|
||
set description(description: StringElement) { | ||
this.set('description', description); | ||
} | ||
|
||
get name(): StringElement { | ||
return this.get('name'); | ||
} | ||
|
||
set name(name: StringElement) { | ||
this.set('name', name); | ||
} | ||
|
||
get in(): StringElement { | ||
return this.get('in'); | ||
} | ||
|
||
set in(inVal: StringElement) { | ||
this.set('in', inVal); | ||
} | ||
|
||
get scheme(): StringElement { | ||
return this.get('scheme'); | ||
} | ||
|
||
set scheme(scheme: StringElement) { | ||
this.set('scheme', scheme); | ||
} | ||
|
||
get bearerFormat(): StringElement { | ||
return this.get('bearerFormat'); | ||
} | ||
|
||
set bearerFormat(bearerFormat: StringElement) { | ||
this.set('bearerFormat', bearerFormat); | ||
} | ||
|
||
get flows(): OAuthFlowsElement { | ||
return this.get('flows'); | ||
} | ||
|
||
set flows(flows: OAuthFlowsElement) { | ||
this.set('flows', flows); | ||
} | ||
|
||
get openIdConnectUrl(): StringElement { | ||
return this.get('openIdConnectUrl'); | ||
} | ||
|
||
set openIdConnectUrl(openIdConnectUrl: StringElement) { | ||
this.set('openIdConnectUrl', openIdConnectUrl); | ||
} | ||
} | ||
|
||
export default SecurityScheme; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
...ns-openapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/BearerFormatVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import stampit from 'stampit'; | ||
|
||
import FallbackVisitor from '../../FallbackVisitor'; | ||
|
||
const BearerFormatVisitor = stampit(FallbackVisitor); | ||
|
||
export default BearerFormatVisitor; |
7 changes: 7 additions & 0 deletions
7
...-ns-openapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/DescriptionVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import stampit from 'stampit'; | ||
|
||
import FallbackVisitor from '../../FallbackVisitor'; | ||
|
||
const DescriptionVisitor = stampit(FallbackVisitor); | ||
|
||
export default DescriptionVisitor; |
7 changes: 7 additions & 0 deletions
7
...es/apidom-ns-openapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/InVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import stampit from 'stampit'; | ||
|
||
import FallbackVisitor from '../../FallbackVisitor'; | ||
|
||
const InVisitor = stampit(FallbackVisitor); | ||
|
||
export default InVisitor; |
7 changes: 7 additions & 0 deletions
7
.../apidom-ns-openapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/NameVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import stampit from 'stampit'; | ||
|
||
import FallbackVisitor from '../../FallbackVisitor'; | ||
|
||
const NameVisitor = stampit(FallbackVisitor); | ||
|
||
export default NameVisitor; |
7 changes: 7 additions & 0 deletions
7
...penapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/OpenIdConnectUrlVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import stampit from 'stampit'; | ||
|
||
import FallbackVisitor from '../../FallbackVisitor'; | ||
|
||
const OpenIdConnectUrlVisitor = stampit(FallbackVisitor); | ||
|
||
export default OpenIdConnectUrlVisitor; |
7 changes: 7 additions & 0 deletions
7
...pidom-ns-openapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/SchemeVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import stampit from 'stampit'; | ||
|
||
import FallbackVisitor from '../../FallbackVisitor'; | ||
|
||
const SchemeVisitor = stampit(FallbackVisitor); | ||
|
||
export default SchemeVisitor; |
7 changes: 7 additions & 0 deletions
7
.../apidom-ns-openapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/TypeVisitor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import stampit from 'stampit'; | ||
|
||
import FallbackVisitor from '../../FallbackVisitor'; | ||
|
||
const TypeVisitor = stampit(FallbackVisitor); | ||
|
||
export default TypeVisitor; |
18 changes: 18 additions & 0 deletions
18
...ckages/apidom-ns-openapi-3-1/src/refractor/visitors/open-api-3-1/security-scheme/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import stampit from 'stampit'; | ||
import { always } from 'ramda'; | ||
|
||
import SecuritySchemeElement from '../../../../elements/SecurityScheme'; | ||
import FallbackVisitor from '../../FallbackVisitor'; | ||
import FixedFieldsVisitor from '../../generics/FixedFieldsVisitor'; | ||
|
||
const SecuritySchemeVisitor = stampit(FixedFieldsVisitor, FallbackVisitor, { | ||
props: { | ||
specPath: always(['document', 'objects', 'SecurityScheme']), | ||
canSupportSpecificationExtensions: true, | ||
}, | ||
init() { | ||
this.element = new SecuritySchemeElement(); | ||
}, | ||
}); | ||
|
||
export default SecuritySchemeVisitor; |