Compare commits

..
Author SHA1 Message Date
Rodrigo Zamboni c51092260a Merge pull request #44 from dadosfera/alpha
Alpha
2022-04-07 16:54:25 -03:00
Victor Radael 8d8c5c000e Merge pull request #43 from dadosfera/alpha
Deploy STG
2022-04-07 16:17:27 -03:00
3 changed files with 23 additions and 39 deletions
+1 -17
View File
@@ -7,22 +7,6 @@ on:
- main
jobs:
extract_environment:
runs-on: ubuntu-latest
outputs:
environment: ${{ steps.extract_environment.outputs.environment }}
steps:
- name: Extract Environment
run: |
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
echo "##[set-output name=environment;]$(echo "prd")"
elif [ ${GITHUB_REF} == "refs/heads/alpha" ]; then
echo "##[set-output name=environment;]$(echo "dev")"
elif [ ${GITHUB_REF} == "refs/heads/beta" ]; then
echo "##[set-output name=environment;]$(echo "stg")"
fi
id: extract_environment
deploy:
runs-on: self-hosted
steps:
@@ -96,7 +80,7 @@ jobs:
if [ ${GITHUB_REF} == "refs/heads/main" ]; then
echo "##[set-output name=result;]$(echo "prd")"
elif [ ${GITHUB_REF} == "refs/heads/alpha" ]; then
echo "##[set-output name=result;]$(echo "dev")"
echo "##[set-output name=result;]$(echo "alpha")"
elif [ ${GITHUB_REF} == "refs/heads/beta" ]; then
echo "##[set-output name=result;]$(echo "stg")"
fi
+3 -1
View File
@@ -1,4 +1,6 @@
<p align="center">
<image src="./assets/maestro.svg" style="width:10rem">
<h1 align="center">Maestro</h1>
</p>
</p>
x
+19 -21
View File
@@ -95,31 +95,29 @@ const verifyToken = async (accessToken: string) => {
try {
await setUp(awsRegion, awsPoolId);
if (!accessToken) {
throw new UnauthorizedException();
}
if (accessToken) {
const user: any = decode(accessToken, { complete: true });
const user: any = decode(accessToken, { complete: true });
if (user === null) {
throw new UnauthorizedException();
}
const { kid } = user.header;
const pem = pems.filter((item: any) => item[kid]);
const pemValue: any = pem[0][kid];
if (!pem) {
throw new UnauthorizedException();
}
verify(accessToken, pemValue, (err: any) => {
if (err) {
if (user === null) {
throw new UnauthorizedException();
}
return;
});
const { kid } = user.header;
const pem = pems.filter((item: any) => item[kid]);
const pemValue: any = pem[0][kid];
if (!pem) {
throw new UnauthorizedException();
}
verify(accessToken, pemValue, (err: any) => {
if (err) {
throw new UnauthorizedException();
}
return;
});
}
} catch (error) {
throw new UnauthorizedException();
}