Skip to content

Commit

Permalink
added 3rd party js libs variables to collection
Browse files Browse the repository at this point in the history
  • Loading branch information
barduinor committed Sep 14, 2023
1 parent ea576ca commit ce1ee4c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,23 @@ class Collection {
* Extracts all server URLs as variables
*/
getVariables () {
return uniq(Object.values(this.openapi.paths).flatMap(endpoints => (
const variables = uniq(Object.values(this.openapi.paths).flatMap(endpoints => (
Object.values(endpoints).map(endpoint => this.server(endpoint).host)
))).map(host => ({
id: Utils.GenID(),
id: Utils.GenID(host),
key: host, // .replace(/\./g, '_'),
value: host,
type: 'string'
}))
// add a variable for each of the JWT JS 3rd party libraries
const libJSRSASign = {
id: Utils.GenID('libJSRSASign'),
key: 'libJSRSASign',
value: null,
type: 'secret'
}
variables.push(libJSRSASign)
return variables
}

/**
Expand Down

0 comments on commit ce1ee4c

Please sign in to comment.