summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2020-07-12 10:29:14 -0700
committerMatthew Miller <matthew@millerti.me>2020-07-12 10:29:14 -0700
commitb45b8168c1e839d26d67d1029df9f5ef0c733a28 (patch)
tree3a5adde938879aaece307d49e1c67a59e2fb9b2c
parentee5df8b202dcfd21e4bf127b16f3f230c00bf08e (diff)
Make FIDO conformance router a little more robust
-rw-r--r--example/fido-conformance.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/example/fido-conformance.js b/example/fido-conformance.js
index f4b6aab..48a9ef6 100644
--- a/example/fido-conformance.js
+++ b/example/fido-conformance.js
@@ -17,18 +17,23 @@ const {
* FIDO2 > TESTS CONFIGURATION > DOWNLOAD SERVER METADATA (button)
*/
// Update this to whatever folder you extracted the statements to
-const conformanceMetadataPath = './fido-conformance-mds-v1.3.4';
-const conformanceMetadataFilenames = fs.readdirSync(conformanceMetadataPath);
const statements = [];
-for (const statementPath of conformanceMetadataFilenames) {
- if (statementPath.endsWith('.json')) {
- const contents = fs.readFileSync(`${conformanceMetadataPath}/${statementPath}`, 'utf-8');
- statements.push(JSON.parse(contents));
+
+try {
+ const conformanceMetadataPath = './fido-conformance-mds-v1.3.4';
+ const conformanceMetadataFilenames = fs.readdirSync(conformanceMetadataPath);
+ for (const statementPath of conformanceMetadataFilenames) {
+ if (statementPath.endsWith('.json')) {
+ const contents = fs.readFileSync(`${conformanceMetadataPath}/${statementPath}`, 'utf-8');
+ statements.push(JSON.parse(contents));
+ }
}
+ console.log('initializing metadata service with', conformanceMetadataFilenames);
+} catch (err) {
+ // pass
}
// Initialize the metadata service with the prepared statements
// For MakeCredential and GetAssertion Request/Response tests
-console.log('initializing metadata service with', conformanceMetadataFilenames);
MetadataService.initialize({
statements,
mdsServers: [],