Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(apiv2) : add apiv2 #4526

Merged
merged 10 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/run-tests-api-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
id: cache-npm
with:
path: |
apiv2/node_modules
node_modules
api/node_modules
app/node_modules
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/run-tests-api-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: API V2 - Run Tests

on:
workflow_dispatch:
workflow_call:
inputs:
branch_name:
required: true
type: string
pull_request:
branches:
- main
merge_group:
types:
- checks_requested

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch_name }}

- name: Node 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x

- uses: actions/cache@v4
id: cache-npm
with:
path: |
apiv2/node_modules
node_modules
api/node_modules
app/node_modules
admin/node_modules
packages/ds/node_modules
packages/lib/node_modules
key: ${{ runner.os }}-nodemodules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-nodemodules-

- name: Install packages
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm ci

- name: Build lib
working-directory: packages/lib
run: npm run build

- name: Run tests
working-directory: apiv2
run: npm test
1 change: 1 addition & 0 deletions .github/workflows/run-tests-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
id: cache-npm
with:
path: |
apiv2/node_modules
node_modules
api/node_modules
app/node_modules
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-tests-front.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
id: cache-npm
with:
path: |
apiv2/node_modules
node_modules
api/node_modules
app/node_modules
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-tests-lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
id: cache-npm
with:
path: |
apiv2/node_modules
node_modules
api/node_modules
app/node_modules
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

.vscode/*
!.vscode/tasks.json
!.vscode/settings.json
.env*
.cache_ggshield
Zammadwebhook.json
Expand Down
23 changes: 23 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"jest.shell": "/bin/zsh",
"jest.virtualFolders": [
{
"name": "snu-api-v2",
"rootPath": "apiv2",
"jestCommandLine": "source ~/.zshrc && nvm use && npm run test --",
"runMode": "on-demand"
},
{
"name": "snu-api-v1",
"rootPath": "api",
"jestCommandLine": "source ~/.zshrc && nvm use && npm run test --",
"runMode": "on-demand"
},
{
"name": "snu-lib",
"rootPath": "packages/lib",
"jestCommandLine": "source ~/.zshrc && nvm use && npm run test --",
"runMode": "watch"
}
]
}
1 change: 1 addition & 0 deletions api/src/controllers/young/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ router.post("/france-connect/user-info", async (req: UserRequest, res) => {

const redisClient = getRedisClient();
storedState = await redisClient.get(`franceConnectState:${value.state}`);
// @ts-ignore
storedNonce = await redisClient.get(`franceConnectNonce:${decodedToken.nonce}`);

if (!token["access_token"] || !token["id_token"] || !storedNonce || !storedState) {
Expand Down
7 changes: 7 additions & 0 deletions apiv2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules/**/*
.DS_Store
dist/**/*
.vscode
.idea
**.js
.env
4 changes: 4 additions & 0 deletions apiv2/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 4,
"printWidth": 120
}
Loading
Loading