Pārlūkot izejas kodu

Disable Swagger2 auth features in OAS3

bubble
Kyle Shockey pirms 7 gadiem
vecāks
revīzija
7e6f74080f
3 mainītis faili ar 38 papildinājumiem un 0 dzēšanām
  1. +33
    -0
      src/core/plugins/oas3/auth-extensions/wrap-selectors.js
  2. +4
    -0
      src/core/plugins/oas3/index.js
  3. +1
    -0
      src/core/plugins/oas3/spec-extensions/wrap-selectors.js

+ 33
- 0
src/core/plugins/oas3/auth-extensions/wrap-selectors.js Parādīt failu

@@ -0,0 +1,33 @@
import { createSelector } from "reselect"
import { Map } from "immutable"
import { isOAS3 as isOAS3Helper, isSwagger2 as isSwagger2Helper } from "../helpers"


// Helpers

function onlyOAS3(selector) {
return (ori, system) => (...args) => {
const spec = system.getSystem().specSelectors.specJson()
if(isOAS3Helper(spec)) {
return selector(...args)
} else {
return ori(...args)
}
}
}

const state = state => {
return state || Map()
}

const nullSelector = createSelector(() => null)

const OAS3NullSelector = onlyOAS3(nullSelector)

// Hasta la vista, authentication!
export const shownDefinitions = OAS3NullSelector
export const definitionsToAuthorize = OAS3NullSelector
export const getDefinitionsByNames = OAS3NullSelector
export const authorized = OAS3NullSelector
export const isAuthorized = OAS3NullSelector
export const getConfigs = OAS3NullSelector

+ 4
- 0
src/core/plugins/oas3/index.js Parādīt failu

@@ -1,6 +1,7 @@
// import reducers from "./reducers"
// import * as actions from "./actions"
import * as specWrapSelectors from "./spec-extensions/wrap-selectors"
import * as authWrapSelectors from "./auth-extensions/wrap-selectors"
import * as specSelectors from "./spec-extensions/selectors"
import components from "./components"
import wrapComponents from "./wrap-components"
@@ -17,6 +18,9 @@ export default function() {
wrapSelectors: specWrapSelectors,
selectors: specSelectors
},
auth: {
wrapSelectors: authWrapSelectors
},
oas3: {
actions: oas3Actions,
reducers: oas3Reducers,


+ 1
- 0
src/core/plugins/oas3/spec-extensions/wrap-selectors.js Parādīt failu

@@ -53,6 +53,7 @@ export const basePath = OAS3NullSelector
export const consumes = OAS3NullSelector
export const produces = OAS3NullSelector
export const schemes = OAS3NullSelector
export const securityDefinitions = OAS3NullSelector

// New selectors



Notiek ielāde…
Atcelt
Saglabāt