From 9f62f1fd160a269337f4ed130282ad38e73f2562 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <akhileshnirapure@users.noreply.github.com> Date: Fri, 21 Jul 2023 10:36:16 +0200 Subject: [PATCH 01/17] ci: add Azure Static Web Apps workflow file on-behalf-of: @Azure opensource@microsoft.com --- ...static-web-apps-black-desert-01c789f03.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/azure-static-web-apps-black-desert-01c789f03.yml diff --git a/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml new file mode 100644 index 00000000..1c84e27a --- /dev/null +++ b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml @@ -0,0 +1,45 @@ +name: Azure Static Web Apps CI/CD + +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened, closed] + branches: + - main + +jobs: + build_and_deploy_job: + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') + runs-on: ubuntu-latest + name: Build and Deploy Job + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Build And Deploy + id: builddeploy + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_BLACK_DESERT_01C789F03 }} + repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments) + action: "upload" + ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### + # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig + app_location: "/src" # App source code path + api_location: "api" # Api source code path - optional + output_location: "/src" # Built app content directory - optional + ###### End of Repository/Build Configurations ###### + + close_pull_request_job: + if: github.event_name == 'pull_request' && github.event.action == 'closed' + runs-on: ubuntu-latest + name: Close Pull Request Job + steps: + - name: Close Pull Request + id: closepullrequest + uses: Azure/static-web-apps-deploy@v1 + with: + azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_BLACK_DESERT_01C789F03 }} + action: "close" From 7408a6877fce7d28c914ec6fab75b21db9b3d34d Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Fri, 21 Jul 2023 12:30:59 +0200 Subject: [PATCH 02/17] feat: adding api --- .vscode/extensions.json | 5 + .vscode/launch.json | 12 +++ .vscode/settings.json | 8 ++ .vscode/tasks.json | 33 +++++++ api/.funcignore | 10 ++ api/.gitignore | 99 +++++++++++++++++++ api/host.json | 15 +++ api/message/function.json | 19 ++++ api/message/index.js | 5 + api/message/sample.dat | 3 + api/package.json | 11 +++ src/index.html | 20 ++-- ...derio-9598a6a8c3e7144e7dcc13ee9831752a.txt | 1 + 13 files changed, 235 insertions(+), 6 deletions(-) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 .vscode/settings.json create mode 100644 .vscode/tasks.json create mode 100644 api/.funcignore create mode 100644 api/.gitignore create mode 100644 api/host.json create mode 100644 api/message/function.json create mode 100644 api/message/index.js create mode 100644 api/message/sample.dat create mode 100644 api/package.json create mode 100644 src/loaderio-9598a6a8c3e7144e7dcc13ee9831752a.txt diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..036c4083 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "ms-azuretools.vscode-azurefunctions" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..e7be0445 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,12 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Attach to Node Functions", + "type": "node", + "request": "attach", + "port": 9229, + "preLaunchTask": "func: host start" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..35a8360f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "azureFunctions.deploySubpath": "api", + "azureFunctions.postDeployTask": "npm install (functions)", + "azureFunctions.projectLanguage": "JavaScript", + "azureFunctions.projectRuntime": "~4", + "debug.internalConsoleOptions": "neverOpen", + "azureFunctions.preDeployTask": "npm prune (functions)" +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..3201931e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,33 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "func", + "label": "func: host start", + "command": "host start", + "problemMatcher": "$func-node-watch", + "isBackground": true, + "dependsOn": "npm install (functions)", + "options": { + "cwd": "${workspaceFolder}/api" + } + }, + { + "type": "shell", + "label": "npm install (functions)", + "command": "npm install", + "options": { + "cwd": "${workspaceFolder}/api" + } + }, + { + "type": "shell", + "label": "npm prune (functions)", + "command": "npm prune --production", + "problemMatcher": [], + "options": { + "cwd": "${workspaceFolder}/api" + } + } + ] +} \ No newline at end of file diff --git a/api/.funcignore b/api/.funcignore new file mode 100644 index 00000000..d5b3b4a2 --- /dev/null +++ b/api/.funcignore @@ -0,0 +1,10 @@ +*.js.map +*.ts +.git* +.vscode +__azurite_db*__.json +__blobstorage__ +__queuestorage__ +local.settings.json +test +tsconfig.json \ No newline at end of file diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 00000000..01774db7 --- /dev/null +++ b/api/.gitignore @@ -0,0 +1,99 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# next.js build output +.next + +# nuxt.js build output +.nuxt + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TypeScript output +dist +out + +# Azure Functions artifacts +bin +obj +appsettings.json +local.settings.json + +# Azurite artifacts +__blobstorage__ +__queuestorage__ +__azurite_db*__.json \ No newline at end of file diff --git a/api/host.json b/api/host.json new file mode 100644 index 00000000..fd4bee79 --- /dev/null +++ b/api/host.json @@ -0,0 +1,15 @@ +{ + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingSettings": { + "isEnabled": true, + "excludedTypes": "Request" + } + } + }, + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle", + "version": "[3.*, 4.0.0)" + } +} \ No newline at end of file diff --git a/api/message/function.json b/api/message/function.json new file mode 100644 index 00000000..9f2d4d85 --- /dev/null +++ b/api/message/function.json @@ -0,0 +1,19 @@ +{ + "bindings": [ + { + "authLevel": "anonymous", + "type": "httpTrigger", + "direction": "in", + "name": "req", + "methods": [ + "get", + "post" + ] + }, + { + "type": "http", + "direction": "out", + "name": "res" + } + ] +} \ No newline at end of file diff --git a/api/message/index.js b/api/message/index.js new file mode 100644 index 00000000..cbbabf89 --- /dev/null +++ b/api/message/index.js @@ -0,0 +1,5 @@ +module.exports = async function (context, req) { + context.res.json({ + text: "Hello from the API" + }); +}; \ No newline at end of file diff --git a/api/message/sample.dat b/api/message/sample.dat new file mode 100644 index 00000000..26aac46f --- /dev/null +++ b/api/message/sample.dat @@ -0,0 +1,3 @@ +{ + "name": "Azure" +} \ No newline at end of file diff --git a/api/package.json b/api/package.json new file mode 100644 index 00000000..4342e1b2 --- /dev/null +++ b/api/package.json @@ -0,0 +1,11 @@ +{ + "name": "api", + "version": "1.0.0", + "description": "", + "scripts": { + "start": "func start", + "test": "echo \"No tests yet...\"" + }, + "dependencies": {}, + "devDependencies": {} +} \ No newline at end of file diff --git a/src/index.html b/src/index.html index d5fd5a92..82b20a73 100644 --- a/src/index.html +++ b/src/index.html @@ -2,16 +2,24 @@ <html lang="en"> <head> - <meta charset="UTF-8"> - <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <link rel="stylesheet" href="styles.css"> - <title>Vanilla JavaScript App</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" href="styles.css"> + <title>Vanilla JavaScript App</title> </head> <body> - <main> + <main> <h1>Vanilla JavaScript App</h1> - </main> + <p>Loading content from the API: <b id="name">...</b></p> + </main> + + <script> + (async function() { + const { text } = await( await fetch(`/api/message`)).json(); + document.querySelector('#name').textContent = text; + }()); + </script> </body> </html> \ No newline at end of file diff --git a/src/loaderio-9598a6a8c3e7144e7dcc13ee9831752a.txt b/src/loaderio-9598a6a8c3e7144e7dcc13ee9831752a.txt new file mode 100644 index 00000000..f5c25cfa --- /dev/null +++ b/src/loaderio-9598a6a8c3e7144e7dcc13ee9831752a.txt @@ -0,0 +1 @@ +loaderio-9598a6a8c3e7144e7dcc13ee9831752a \ No newline at end of file From 71121f6b617447936c7d29c7f6c41cbfea5faa59 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Fri, 21 Jul 2023 12:33:09 +0200 Subject: [PATCH 03/17] feat:add api --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index 82b20a73..6320b792 100644 --- a/src/index.html +++ b/src/index.html @@ -17,7 +17,7 @@ <h1>Vanilla JavaScript App</h1> <script> (async function() { const { text } = await( await fetch(`/api/message`)).json(); - document.querySelector('#name').textContent = text; + document.querySelector('#name').textContent = text; }()); </script> </body> From 1244c63cd5df41892f1bb5b673787e13064806aa Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Fri, 21 Jul 2023 16:24:04 +0200 Subject: [PATCH 04/17] adding new verififcation for block11.xyz --- src/loaderio-032d0fee4b0d62a178afd1b323636a8e.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/loaderio-032d0fee4b0d62a178afd1b323636a8e.txt diff --git a/src/loaderio-032d0fee4b0d62a178afd1b323636a8e.txt b/src/loaderio-032d0fee4b0d62a178afd1b323636a8e.txt new file mode 100644 index 00000000..85fbe415 --- /dev/null +++ b/src/loaderio-032d0fee4b0d62a178afd1b323636a8e.txt @@ -0,0 +1 @@ +loaderio-032d0fee4b0d62a178afd1b323636a8e \ No newline at end of file From 258dcfbbdd0aaa1ae14c5af134af0854dff9f812 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 15:57:56 +0200 Subject: [PATCH 05/17] adding b2c --- staticwebapp.config.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 staticwebapp.config.json diff --git a/staticwebapp.config.json b/staticwebapp.config.json new file mode 100644 index 00000000..c0954ef1 --- /dev/null +++ b/staticwebapp.config.json @@ -0,0 +1,24 @@ +{ + "auth": { + "identityProviders": { + "customOpenIdConnectProviders": { + "aadb2c": { + "registration": { + "clientIdSettingName": "AADB2C_PROVIDER_CLIENT_ID", + "clientCredential": { + "clientSecretSettingName": "AADB2C_PROVIDER_CLIENT_SECRET" + }, + "openIdConnectConfiguration": { + "wellKnownOpenIdConfiguration": "https://itcssob2cdev.b2clogin.com/itcssob2cdev.onmicrosoft.com/B2C_1A_ITC_SUSI_SOCIAL/v2.0/.well-known/openid-configuration" + } + }, + "login": { + "nameClaimType": "email", + "scopes": ["openid"], + "loginParameterNames": [] + } + } + } + } + } + } \ No newline at end of file From e0b23f546741d85ae205d4ae6ebb414a4bb87558 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 16:06:36 +0200 Subject: [PATCH 06/17] adding route --- staticwebapp.config.json | 56 ++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/staticwebapp.config.json b/staticwebapp.config.json index c0954ef1..3d8bbb87 100644 --- a/staticwebapp.config.json +++ b/staticwebapp.config.json @@ -1,24 +1,42 @@ { + "routes": [ + { + "route": "/admin/*", + "allowedRoles": [ + "authenticated" + ] + }, + { + "route": "/login", + "rewrite": "/.auth/login/aadb2c" + }, + { + "route": "/logout", + "redirect": "/.auth/logout" + } + ], "auth": { - "identityProviders": { - "customOpenIdConnectProviders": { - "aadb2c": { - "registration": { - "clientIdSettingName": "AADB2C_PROVIDER_CLIENT_ID", - "clientCredential": { - "clientSecretSettingName": "AADB2C_PROVIDER_CLIENT_SECRET" - }, - "openIdConnectConfiguration": { - "wellKnownOpenIdConfiguration": "https://itcssob2cdev.b2clogin.com/itcssob2cdev.onmicrosoft.com/B2C_1A_ITC_SUSI_SOCIAL/v2.0/.well-known/openid-configuration" - } - }, - "login": { - "nameClaimType": "email", - "scopes": ["openid"], - "loginParameterNames": [] + "identityProviders": { + "customOpenIdConnectProviders": { + "aadb2c": { + "registration": { + "clientIdSettingName": "AADB2C_PROVIDER_CLIENT_ID", + "clientCredential": { + "clientSecretSettingName": "AADB2C_PROVIDER_CLIENT_SECRET" + }, + "openIdConnectConfiguration": { + "wellKnownOpenIdConfiguration": "https://itcssob2cdev.b2clogin.com/itcssob2cdev.onmicrosoft.com/B2C_1A_ITC_SUSI_SOCIAL/v2.0/.well-known/openid-configuration" + } + }, + "login": { + "nameClaimType": "email", + "scopes": [ + "openid" + ], + "loginParameterNames": [] + } + } } - } } - } } - } \ No newline at end of file +} \ No newline at end of file From 8205e4f3622082798d5c8788d17526fb6addf9cd Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 16:17:39 +0200 Subject: [PATCH 07/17] adding 404 routes --- staticwebapp.config.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/staticwebapp.config.json b/staticwebapp.config.json index 3d8bbb87..61306fab 100644 --- a/staticwebapp.config.json +++ b/staticwebapp.config.json @@ -1,4 +1,5 @@ { + "trailingSlash": "auto", "routes": [ { "route": "/admin/*", @@ -6,6 +7,14 @@ "authenticated" ] }, + { + "route": "/.auth/login/twitter", + "statusCode": 404 + }, + { + "route": "/.auth/login/github", + "statusCode": 404 + }, { "route": "/login", "rewrite": "/.auth/login/aadb2c" From 1f57c0d4743c70157c3d1d9e89d2f71d4b692c5b Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 16:31:52 +0200 Subject: [PATCH 08/17] adding scopes --- staticwebapp.config.json | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/staticwebapp.config.json b/staticwebapp.config.json index 61306fab..fd7c22ab 100644 --- a/staticwebapp.config.json +++ b/staticwebapp.config.json @@ -2,21 +2,32 @@ "trailingSlash": "auto", "routes": [ { - "route": "/admin/*", - "allowedRoles": [ - "authenticated" - ] + "route": "/.auth/login/facebook", + "allowedRoles": ["anonymous", "authenticated"], + "statusCode": 404 }, { - "route": "/.auth/login/twitter", + "route": "/.auth/login/github", + "allowedRoles": ["anonymous", "authenticated"], "statusCode": 404 }, { - "route": "/.auth/login/github", + "route": "/.auth/login/google", + "allowedRoles": ["anonyous", "authenticated"], "statusCode": 404 }, + { + "route": "/.auth/login/twitter", + "allowedRoles": ["anonymous", "authenticated"], + "statusCode": 404 + }, + { + "route": "/*", + "allowedRoles": ["authenticated"] + }, { "route": "/login", + "allowedRoles": ["anonymous"], "rewrite": "/.auth/login/aadb2c" }, { @@ -24,6 +35,12 @@ "redirect": "/.auth/logout" } ], + "responseOverrides": { + "401": { + "statusCode": 302, + "redirect": "/login" + } + }, "auth": { "identityProviders": { "customOpenIdConnectProviders": { @@ -40,7 +57,7 @@ "login": { "nameClaimType": "email", "scopes": [ - "openid" + "openid","profile","offline_access" ], "loginParameterNames": [] } From 6d595f5d6fae68e3df35b27ceb858ebe72b20e44 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 16:39:06 +0200 Subject: [PATCH 09/17] updating route --- staticwebapp.config.json | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/staticwebapp.config.json b/staticwebapp.config.json index fd7c22ab..2976b489 100644 --- a/staticwebapp.config.json +++ b/staticwebapp.config.json @@ -1,30 +1,6 @@ { "trailingSlash": "auto", "routes": [ - { - "route": "/.auth/login/facebook", - "allowedRoles": ["anonymous", "authenticated"], - "statusCode": 404 - }, - { - "route": "/.auth/login/github", - "allowedRoles": ["anonymous", "authenticated"], - "statusCode": 404 - }, - { - "route": "/.auth/login/google", - "allowedRoles": ["anonyous", "authenticated"], - "statusCode": 404 - }, - { - "route": "/.auth/login/twitter", - "allowedRoles": ["anonymous", "authenticated"], - "statusCode": 404 - }, - { - "route": "/*", - "allowedRoles": ["authenticated"] - }, { "route": "/login", "allowedRoles": ["anonymous"], @@ -56,9 +32,7 @@ }, "login": { "nameClaimType": "email", - "scopes": [ - "openid","profile","offline_access" - ], + "scopes": [], "loginParameterNames": [] } } From 84d610608707cfd05f8477de0aa25776a66fa0d7 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 16:44:59 +0200 Subject: [PATCH 10/17] updated route --- staticwebapp.config.json | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/staticwebapp.config.json b/staticwebapp.config.json index 2976b489..ffbb1fb0 100644 --- a/staticwebapp.config.json +++ b/staticwebapp.config.json @@ -1,6 +1,30 @@ { "trailingSlash": "auto", "routes": [ + { + "route": "/.auth/login/aad", + "statusCode": 404 + }, + { + "route": "/.auth/login/apple", + "statusCode": 404 + }, + { + "route": "/.auth/login/facebook", + "statusCode": 404 + }, + { + "route": "/.auth/login/github", + "statusCode": 404 + }, + { + "route": "/.auth/login/google", + "statusCode": 404 + }, + { + "route": "/.auth/login/twitter", + "statusCode": 404 + }, { "route": "/login", "allowedRoles": ["anonymous"], From bd595ffc149f289376df9e6739f2e28ac6952e4e Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 17:00:04 +0200 Subject: [PATCH 11/17] added page --- src/2.html | 25 +++++++++++++++++++++++++ staticwebapp.config.json | 5 +++++ 2 files changed, 30 insertions(+) create mode 100644 src/2.html diff --git a/src/2.html b/src/2.html new file mode 100644 index 00000000..dcd1ffd8 --- /dev/null +++ b/src/2.html @@ -0,0 +1,25 @@ +<!DOCTYPE html> +<html lang="en"> + +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link rel="stylesheet" href="styles.css"> + <title>Vanilla JavaScript App</title> +</head> + +<body> + <main> + <h1>Page 1</h1> + <p>Loading content from the API: <b id="name">...</b></p> + </main> + + <!-- <script> + (async function() { + const { text } = await( await fetch(`/api/message`)).json(); + document.querySelector('#name').textContent = text; + }()); + </script> --> +</body> + +</html> \ No newline at end of file diff --git a/staticwebapp.config.json b/staticwebapp.config.json index ffbb1fb0..35649835 100644 --- a/staticwebapp.config.json +++ b/staticwebapp.config.json @@ -30,6 +30,11 @@ "allowedRoles": ["anonymous"], "rewrite": "/.auth/login/aadb2c" }, + { + "route": "/new", + "allowedRoles": ["anonymous"], + "rewrite": "/1.html" + }, { "route": "/logout", "redirect": "/.auth/logout" From 8d010dbf76db5118878edfe04fb5e5f142616fdd Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 17:04:48 +0200 Subject: [PATCH 12/17] updating --- staticwebapp.config.json | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/staticwebapp.config.json b/staticwebapp.config.json index 35649835..3e22d6e1 100644 --- a/staticwebapp.config.json +++ b/staticwebapp.config.json @@ -27,25 +27,22 @@ }, { "route": "/login", - "allowedRoles": ["anonymous"], + "allowedRoles": [ + "anonymous" + ], "rewrite": "/.auth/login/aadb2c" }, { - "route": "/new", - "allowedRoles": ["anonymous"], - "rewrite": "/1.html" + "route": "/*", + "allowedRoles": [ + "authenticated" + ] }, { "route": "/logout", "redirect": "/.auth/logout" } ], - "responseOverrides": { - "401": { - "statusCode": 302, - "redirect": "/login" - } - }, "auth": { "identityProviders": { "customOpenIdConnectProviders": { From 6c00a5ea810f78dd905287955c300346d670c6d9 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 17:09:55 +0200 Subject: [PATCH 13/17] changing location --- staticwebapp.config.json => src/staticwebapp.config.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename staticwebapp.config.json => src/staticwebapp.config.json (100%) diff --git a/staticwebapp.config.json b/src/staticwebapp.config.json similarity index 100% rename from staticwebapp.config.json rename to src/staticwebapp.config.json From 3b9b97b34c6b5792ace6464095c9b34dce84ae8c Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Tue, 1 Aug 2023 17:12:12 +0200 Subject: [PATCH 14/17] chore updateing route --- src/staticwebapp.config.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/staticwebapp.config.json b/src/staticwebapp.config.json index 3e22d6e1..f3612eb2 100644 --- a/src/staticwebapp.config.json +++ b/src/staticwebapp.config.json @@ -32,12 +32,6 @@ ], "rewrite": "/.auth/login/aadb2c" }, - { - "route": "/*", - "allowedRoles": [ - "authenticated" - ] - }, { "route": "/logout", "redirect": "/.auth/logout" From d714c5adbe5f53581450d91345a15923a14df24b Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Wed, 2 Aug 2023 12:37:41 +0200 Subject: [PATCH 15/17] chore removing managed azure function api --- .../workflows/azure-static-web-apps-black-desert-01c789f03.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml index 1c84e27a..51f9f123 100644 --- a/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml +++ b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml @@ -28,7 +28,8 @@ jobs: ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "/src" # App source code path - api_location: "api" # Api source code path - optional + # api_location: "api" # Api source code path - optional + skip_api_build: true output_location: "/src" # Built app content directory - optional ###### End of Repository/Build Configurations ###### From b0993fa269ee9097a4ee13554ed20cfd8d0f1c50 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Wed, 2 Aug 2023 12:40:10 +0200 Subject: [PATCH 16/17] skipping api build --- .../azure-static-web-apps-black-desert-01c789f03.yml | 4 ++-- {api => func_api}/.funcignore | 0 {api => func_api}/.gitignore | 0 {api => func_api}/host.json | 0 {api => func_api}/message/function.json | 0 {api => func_api}/message/index.js | 0 {api => func_api}/message/sample.dat | 0 {api => func_api}/package.json | 0 8 files changed, 2 insertions(+), 2 deletions(-) rename {api => func_api}/.funcignore (100%) rename {api => func_api}/.gitignore (100%) rename {api => func_api}/host.json (100%) rename {api => func_api}/message/function.json (100%) rename {api => func_api}/message/index.js (100%) rename {api => func_api}/message/sample.dat (100%) rename {api => func_api}/package.json (100%) diff --git a/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml index 51f9f123..3af2f2af 100644 --- a/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml +++ b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml @@ -28,8 +28,8 @@ jobs: ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "/src" # App source code path - # api_location: "api" # Api source code path - optional - skip_api_build: true + api_location: "api" # Api source code path - optional + # skip_api_build: true output_location: "/src" # Built app content directory - optional ###### End of Repository/Build Configurations ###### diff --git a/api/.funcignore b/func_api/.funcignore similarity index 100% rename from api/.funcignore rename to func_api/.funcignore diff --git a/api/.gitignore b/func_api/.gitignore similarity index 100% rename from api/.gitignore rename to func_api/.gitignore diff --git a/api/host.json b/func_api/host.json similarity index 100% rename from api/host.json rename to func_api/host.json diff --git a/api/message/function.json b/func_api/message/function.json similarity index 100% rename from api/message/function.json rename to func_api/message/function.json diff --git a/api/message/index.js b/func_api/message/index.js similarity index 100% rename from api/message/index.js rename to func_api/message/index.js diff --git a/api/message/sample.dat b/func_api/message/sample.dat similarity index 100% rename from api/message/sample.dat rename to func_api/message/sample.dat diff --git a/api/package.json b/func_api/package.json similarity index 100% rename from api/package.json rename to func_api/package.json From a44e25a06b639bffa5ab0b19435eb97f4c515e65 Mon Sep 17 00:00:00 2001 From: Akhilesh Nirapure <nirapure@unicc.org> Date: Wed, 2 Aug 2023 12:43:13 +0200 Subject: [PATCH 17/17] skipping build of api --- .../azure-static-web-apps-black-desert-01c789f03.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml index 3af2f2af..51f9f123 100644 --- a/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml +++ b/.github/workflows/azure-static-web-apps-black-desert-01c789f03.yml @@ -28,8 +28,8 @@ jobs: ###### Repository/Build Configurations - These values can be configured to match your app requirements. ###### # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig app_location: "/src" # App source code path - api_location: "api" # Api source code path - optional - # skip_api_build: true + # api_location: "api" # Api source code path - optional + skip_api_build: true output_location: "/src" # Built app content directory - optional ###### End of Repository/Build Configurations ######