Skip to content

Commit

Permalink
Clean up #51
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ignatov committed Jun 12, 2021
1 parent c612346 commit 07ab7f8
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 1,483 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ selenium-debug.log
.vscode
coverage
.nyc_output
tests/e2e/selenium-server.log
tests/e2e/bin/chromedriver
tests/e2e/bin/selenium.jar
tests/e2e/reports/login-screen.xml
tests/e2e/reports/main.xml
test/e2e/selenium-server.log
test/e2e/bin/chromedriver
test/e2e/bin/selenium.jar
test/e2e/reports/login-screen.xml
test/e2e/reports/main.xml
85 changes: 0 additions & 85 deletions benchmark.js

This file was deleted.

14 changes: 7 additions & 7 deletions nightwatch.conf.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

module.exports = {
"src_folders" : ["tests/e2e/spec"],
"output_folder" : "tests/e2e/reports",
"src_folders" : ["test/e2e/spec"],
"output_folder" : "test/e2e/reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "tests/e2e/globals.js",
"globals_path" : "test/e2e/globals.js",

"selenium" : {
"start_process" : true,
"server_path" : "tests/e2e/bin/selenium.jar",
"log_path" : "tests/e2e",
"server_path" : "test/e2e/bin/selenium.jar",
"log_path" : "test/e2e",
"host" : "127.0.0.1",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "tests/e2e/bin/chromedriver",
"webdriver.chrome.driver" : "test/e2e/bin/chromedriver",
"webdriver.ie.driver" : ""
}
},
Expand All @@ -27,7 +27,7 @@ module.exports = {
"silent": true,
"screenshots" : {
"enabled" : false,
"path" : "tests/e2e/screenshots"
"path" : "test/e2e/screenshots"
},
"desiredCapabilities": {
"browserName": "chrome",
Expand Down
2 changes: 1 addition & 1 deletion selenium-download.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var selenium = require('selenium-download');
selenium.ensure('./tests/e2e/bin', function(error) {
selenium.ensure('./test/e2e/bin', function(error) {
if (error) {
console.error(error.stack);
}
Expand Down
8 changes: 5 additions & 3 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function getPath(obj, path = "") {
* whatever is supplied in the rest of the arguments. If no argument is supplied
* the "%s" token is left as is.
* @param {String} s The string to format
* @param {*} ... The rest of the arguments are used for the replacements
* @param {*[]} ... The rest of the arguments are used for the replacements
* @return {String}
*/
function printf(s) {
Expand Down Expand Up @@ -78,7 +78,9 @@ function redirectWithError(req, res, name, ...rest) {
}

function replyWithError(res, name, code = 500, ...params) {
return res.status(code).send(getErrorText(name, ...params));
res.status(code)
res.set('Content-Type', 'text/plain')
return res.send(getErrorText(name, ...params));
}

function getErrorText(name, ...rest) {
Expand Down Expand Up @@ -194,7 +196,7 @@ function augmentConformance(bodyText, authBaseUrl) {
let json;
try {
json = JSON.parse(bodyText);
if (!json.rest[0].security){
if (!json.rest[0].security) {
json.rest[0].security = {};
}
} catch (e) {
Expand Down
34 changes: 20 additions & 14 deletions src/wellKnownOIDCConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ module.exports = (req, res) => {

const json = {

// REQUIRED. URL using the https scheme with no query or fragment component that the OP asserts as
// its Issuer Identifier. If Issuer discovery is supported (see Section 2), this value MUST be identical
// to the issuer value returned by WebFinger. This also MUST be identical to the iss Claim value in
// ID Tokens issued from this Issuer.
// REQUIRED. URL using the https scheme with no query or fragment
// component that the OP asserts as its Issuer Identifier. If Issuer
// discovery is supported (see Section 2), this value MUST be identical
// to the issuer value returned by WebFinger. This also MUST be
// identical to the iss Claim value in ID Tokens issued from this Issuer.
issuer: `${config.baseUrl}`,

// REQUIRED. URL of the OPs JSON Web Key Set [JWK] document. This contains the signing key(s) the RP uses
// to validate signatures from the OP. The JWK Set MAY also contain the Server's encryption key(s),
// which are used by RPs to encrypt requests to the Server. When both signing and encryption keys are made
// available, a use (Key Use) parameter value is REQUIRED for all keys in the referenced JWK Set to indicate
// each keys intended usage. Although some algorithms allow the same key to be used for both signatures and
// encryption, doing so is NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be used to provide
// X.509 representations of keys provided. When used, the bare key values MUST still be present and MUST match
// those in the certificate.
// REQUIRED. URL of the OPs JSON Web Key Set [JWK] document. This
// contains the signing key(s) the RP uses to validate signatures from
// the OP. The JWK Set MAY also contain the Server's encryption key(s),
// which are used by RPs to encrypt requests to the Server. When both
// signing and encryption keys are made available, a use (Key Use)
// parameter value is REQUIRED for all keys in the referenced JWK Set to
// indicate each keys intended usage. Although some algorithms allow the
// same key to be used for both signatures and encryption, doing so is
// NOT RECOMMENDED, as it is less secure. The JWK x5c parameter MAY be
// used to provide X.509 representations of keys provided. When used,
// the bare key values MUST still be present and MUST match those in the
// certificate.
jwks_uri: `${config.baseUrl}/keys`,

// REQUIRED, URL to the OAuth2 authorization endpoint.
Expand All @@ -32,8 +37,9 @@ module.exports = (req, res) => {
// OPTIONAL, URL of the authorization server's introspection endpoint.
introspection_endpoint: `${prefix}/introspect`,

// REQUIRED. JSON array containing a list of the Subject Identifier types that this OP supports. Valid types include pairwise and public.
"subject_types_supported": [
// REQUIRED. JSON array containing a list of the Subject Identifier
// types that this OP supports. Valid types include pairwise and public.
subject_types_supported: [
"public"
]

Expand Down
Loading

0 comments on commit 07ab7f8

Please sign in to comment.