Relatively small QOL updates + bumped auth library version
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 34s
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 34s
This commit is contained in:
parent
b6b611486f
commit
e6780f7a20
4 changed files with 39 additions and 6 deletions
|
|
@ -39,7 +39,7 @@
|
||||||
"create-ba-web-app": "node ./bin/create-project.js"
|
"create-ba-web-app": "node ./bin/create-project.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@BridgemanAccessible/ba-auth": "^1.0.39",
|
"@BridgemanAccessible/ba-auth": "^1.0.40",
|
||||||
"@BridgemanAccessible/ba-logging": "^1.0.1",
|
"@BridgemanAccessible/ba-logging": "^1.0.1",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"fs-extra": "^11.2.0",
|
"fs-extra": "^11.2.0",
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,15 @@ import { Initializer } from './Initializer.js';
|
||||||
import { Router } from './Router.js';
|
import { Router } from './Router.js';
|
||||||
import { Renderer } from './Renderer.js';
|
import { Renderer } from './Renderer.js';
|
||||||
import { StaticFileResolver } from './StaticFileResolver.js';
|
import { StaticFileResolver } from './StaticFileResolver.js';
|
||||||
|
import { HealthCheckableRequestClient } from './utils/HealthCheckableRequestClient.js'
|
||||||
|
|
||||||
export {
|
export {
|
||||||
App,
|
App,
|
||||||
Initializer,
|
Initializer,
|
||||||
Router,
|
Router,
|
||||||
Renderer,
|
Renderer,
|
||||||
StaticFileResolver
|
StaticFileResolver,
|
||||||
|
HealthCheckableRequestClient
|
||||||
};
|
};
|
||||||
|
|
||||||
export * from './controllers/index.js';
|
export * from './controllers/index.js';
|
||||||
|
|
|
||||||
|
|
@ -233,6 +233,37 @@ export class OAuthApp<TCustomClaims extends BridgemanAccessibleAppClaims> extend
|
||||||
// Because this is largely based on human intervention, exponentiation of the index by 5 (minutes), to a maximum of about 13 hours seemed reasonable
|
// Because this is largely based on human intervention, exponentiation of the index by 5 (minutes), to a maximum of about 13 hours seemed reasonable
|
||||||
let active = this.client.isActive();
|
let active = this.client.isActive();
|
||||||
if(!active) {
|
if(!active) {
|
||||||
|
// Before we start waiting, we should check the status of the app once to see if it becomes active in the meantime (since there could be some time between when the client was set up and when we check the status here)
|
||||||
|
await (new HealthCheckableRequestClient('Authorization Server')).makeRequest(
|
||||||
|
new URL(`https://account.bridgemanaccessible.ca/api/v1/apps/${encodeURIComponent(baseAppUrl.toString())}/status`),
|
||||||
|
'GET',
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
Accept: 'application/json'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then((response) => {
|
||||||
|
if(response.status === 200) {
|
||||||
|
const data = response.data;
|
||||||
|
|
||||||
|
if(data.status === 'active') {
|
||||||
|
logMessage('OAuth client is active!', LogLevel.INFO);
|
||||||
|
|
||||||
|
active = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
logMessage('OAuth client is not active.', LogLevel.DEBUG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
logMessage(`Received non-200 response when checking OAuth client status: ${response.status}`, LogLevel.ERROR);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
logMessage(`Error checking OAuth client status: ${error}`, LogLevel.ERROR);
|
||||||
|
});
|
||||||
|
|
||||||
for(let j = 0;j < 5 && !active;j++) {
|
for(let j = 0;j < 5 && !active;j++) {
|
||||||
// Sleep for:
|
// Sleep for:
|
||||||
// 0: ! Minute
|
// 0: ! Minute
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@BridgemanAccessible/ba-auth@^1.0.39":
|
"@BridgemanAccessible/ba-auth@^1.0.40":
|
||||||
version "1.0.39"
|
version "1.0.40"
|
||||||
resolved "https://npm.pkg.bridgemanaccessible.ca/@BridgemanAccessible/ba-auth/-/ba-auth-1.0.39.tgz#d5b6f87d4ef3365a2d9e053cbd7799f61c5ebeaf"
|
resolved "https://npm.pkg.bridgemanaccessible.ca/@BridgemanAccessible/ba-auth/-/ba-auth-1.0.40.tgz#670a7cc76c972849662a7332d42d0cba8ac6cb44"
|
||||||
integrity sha512-E/GT4ppc+b9Vtma1UvOt2zqXyiHqTWS0U9eiX7BH+encnSMMxmU2bFgWB8/ijumRieLbB+z/OdvoOKJJGpwxtg==
|
integrity sha512-gAEtbEv7Tm2lgLx6EE1501gChZXwa21B7P7AidzvjWIz9Nz3hqm0vBEu4OElMGejk2dEtsw1HHvY+v3O4rQNyg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@BridgemanAccessible/ba-auth_adapters" "^1.0.4"
|
"@BridgemanAccessible/ba-auth_adapters" "^1.0.4"
|
||||||
"@BridgemanAccessible/ba-auth_keystore" "^1.0.1"
|
"@BridgemanAccessible/ba-auth_keystore" "^1.0.1"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue