-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed domain fallback and fixed callback error handling
- Loading branch information
Showing
6 changed files
with
47 additions
and
61 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
const getAnchoringDomainConfig = (ssiString) => { | ||
const getAnchoringDomainConfig = (domain) => { | ||
const config = require("../../../config"); | ||
const domain = getDomainFromKeySSI(ssiString); | ||
let domainConfig = config.getConfig('endpointsConfig', 'anchoring', 'domainStrategies', domain); | ||
|
||
if (!domainConfig) { | ||
domainConfig = config.getConfig('endpointsConfig', 'anchoring', 'domainStrategies', 'default'); | ||
} | ||
|
||
return domainConfig; | ||
return config.getConfig('endpointsConfig', 'anchoring', 'domainStrategies', domain); | ||
}; | ||
|
||
const getDomainFromKeySSI = function (ssiString) { | ||
const openDSU = require("opendsu"); | ||
const keySSISpace = openDSU.loadApi("keyssi"); | ||
|
||
const keySSI = keySSISpace.parse(ssiString); | ||
const domain = keySSI.getDLDomain(); | ||
return domain; | ||
return keySSI.getDLDomain(); | ||
} | ||
|
||
module.exports = {getAnchoringDomainConfig, getDomainFromKeySSI} |
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