Skip to content

Commit f5941f9

Browse files
zxan1285shawnmclean
authored andcommitted
Exposing ALLOW_AUTHZ (#39)
* ALLOW_AUTHZ secret added to the webtask.json * code comment and description fix * linting
1 parent 96a720f commit f5941f9

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

build/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/lib/config.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
const settings = { };
22
let currentProvider = null;
33

4+
5+
const boolify = (item) => {
6+
// as we're trying to "boolify" every secret, we need to make sure we're processing only boolean secrets
7+
if (item === 'true' || item === 'false') {
8+
return item === 'true';
9+
}
10+
11+
return item;
12+
};
13+
414
const config = (key) => {
515
if (settings && settings[key]) {
6-
return settings[key];
16+
return boolify(settings[key]);
717
}
818

919
if (!currentProvider) {
1020
throw new Error('A configuration provider has not been set');
1121
}
1222

13-
return currentProvider(key);
23+
return boolify(currentProvider(key));
1424
};
1525

1626
config.setProvider = (providerFunction) => {

webtask.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,22 @@
3636
"description": "A CSS file containing custom styles for the extension",
3737
"example": "https://cdn.fabrikam.com/static/extensions/theme/fabrikam.css",
3838
"required": false
39+
},
40+
"ALLOW_AUTHZ": {
41+
"description": "Allow enabling of Authorization Extension integration (Deprecated)",
42+
"type": "select",
43+
"allowMultiple": false,
44+
"default": "false",
45+
"options": [
46+
{
47+
"value": "false",
48+
"text": "No"
49+
},
50+
{
51+
"value": "true",
52+
"text": "Yes"
53+
}
54+
]
3955
}
4056
}
4157
}

0 commit comments

Comments
 (0)