From c3c153aeea26da10d582ece74e692c573776d56d Mon Sep 17 00:00:00 2001 From: Ghadi Mhawej Date: Thu, 12 Sep 2024 16:02:39 +0300 Subject: [PATCH 1/5] feat: started staging deployment preparations --- .../api/auth/auth.get-auth-url.request.api.ts | 2 -- apps/vc-api/src/main.ts | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/vc-api/src/api/auth/auth.get-auth-url.request.api.ts b/apps/vc-api/src/api/auth/auth.get-auth-url.request.api.ts index 2868e48..eed7eb0 100644 --- a/apps/vc-api/src/api/auth/auth.get-auth-url.request.api.ts +++ b/apps/vc-api/src/api/auth/auth.get-auth-url.request.api.ts @@ -1,8 +1,6 @@ import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; enum AuthName { - Google = 'google', - Facebook = 'facebook', Twitter = 'twitter', Github = 'github', Discord = 'discord', diff --git a/apps/vc-api/src/main.ts b/apps/vc-api/src/main.ts index 46a6b6e..3135a3f 100644 --- a/apps/vc-api/src/main.ts +++ b/apps/vc-api/src/main.ts @@ -16,7 +16,8 @@ async function bootstrap() { rawBody: true, } ); - const globalPrefix = ''; + + const globalPrefix = 'verifications'; app.useBodyParser('json'); @@ -44,11 +45,20 @@ async function bootstrap() { }, }) ); - app.setGlobalPrefix(globalPrefix); + + const version = '1'; + + app + .enableVersioning({ + type: VersioningType.URI, + defaultVersion: version, + }) + .setGlobalPrefix(globalPrefix); + const port = process.env.PORT || 3000; await app.listen(port); Logger.log( - `🚀 Application is running on: http://localhost:${port}/${globalPrefix}` + `🚀 Application is running on: http://localhost:${port}/${globalPrefix}/v${version}`, ); } From cfccf35737026a8ae78d91bdbc58fbb48a3375b0 Mon Sep 17 00:00:00 2001 From: Ghadi Mhawej Date: Thu, 12 Sep 2024 20:08:06 +0300 Subject: [PATCH 2/5] feat: added dockerfile, k8s deployment files and github action on dev --- .github/workflows/ci-on-develop.yml | 89 +++++++ apps/vc-api/Dockerfile | 33 +++ apps/vc-api/package.json | 22 ++ apps/vc-api/project.json | 23 +- .../subjects/abstract.subject.resolver.ts | 2 +- .../subjects/discord.subject.resolver.ts | 3 - .../subjects/github.subject.resolver.ts | 2 - .../subjects/telegram.subject.resolver.ts | 3 - .../subjects/twitter.subject.resolver.ts | 2 - .../vc-api/src/core/domain/entities/eip712.ts | 1 + .../external/credentails/credential.agent.ts | 1 - k8s-staging/staging-secrets.yaml | 77 ++++++ k8s-staging/vc-api-deployment.yaml | 108 +++++++++ k8s/secrets.yaml | 77 ++++++ k8s/vc-api-deployment.yaml | 108 +++++++++ package.json | 1 + yarn.lock | 219 +++++++++++++++++- 17 files changed, 753 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci-on-develop.yml create mode 100644 apps/vc-api/Dockerfile create mode 100644 k8s-staging/staging-secrets.yaml create mode 100644 k8s-staging/vc-api-deployment.yaml create mode 100644 k8s/secrets.yaml create mode 100644 k8s/vc-api-deployment.yaml diff --git a/.github/workflows/ci-on-develop.yml b/.github/workflows/ci-on-develop.yml new file mode 100644 index 0000000..6cf7e2f --- /dev/null +++ b/.github/workflows/ci-on-develop.yml @@ -0,0 +1,89 @@ +name: ci-on-develop + +on: + pull_request: + branches: ["develop", "staging", "main"] + +jobs: + + determine-affected-projects: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Cache node modules + id: cache + uses: actions/cache@v2 + with: + path: node_modules + key: cache-node-modules-${{ hashFiles('yarn.lock') }} + - uses: actions/setup-node@v1 + if: steps.cache.outputs.cache-hit != 'true' + with: + node-version: 18.18.0 + - name: yarn install + continue-on-error: true + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install --pure-lockfile + + - name: Fetch missing history + run: git fetch + + - name: 'Determine affected projects' + id: affected + run: | + OUTPUT=$(npx nx show projects --affected --base=origin/${{github.event.pull_request.base.ref}} --with-target=container) + echo "Affected projects: $OUTPUT" + OUTPUT="${OUTPUT//[$'\r\n']/ }" + echo "::set-output name=affected::$OUTPUT" + - name: Set output matrix excluding e2e + id: set-matrix + run: | + IFS=' ' + read -ra PROJECTS <<< "${{ steps.affected.outputs.affected }}" + COMPONENTS=() + for PROJECT in "${PROJECTS[@]}"; do + if ! [[ "$PROJECT" =~ -e2e$ ]] && [[ "$PROJECT" != "contracts" ]]; then + COMPONENTS+=("$PROJECT") + fi + done + MATRIX='{"component":[' + for COMPONENT in "${COMPONENTS[@]}"; do + MATRIX+="\"$COMPONENT\"," + done + MATRIX="${MATRIX%,}]}" + echo "::set-output name=matrix::$MATRIX" + build_and_push: + needs: determine-affected-projects + runs-on: ubuntu-latest + if: ${{ needs.determine-affected-projects.outputs.matrix != '{"component":[]}' }} + strategy: + matrix: + component: ${{fromJson(needs.determine-affected-projects.outputs.matrix).component}} + steps: + - name: Debug affected projects + run: echo "${{ needs.determine-affected-projects.outputs.matrix }}" + + - name: Checkout code + uses: actions/checkout@v2 + - run: git fetch --no-tags --prune --depth=1 origin develop + - name: Cache node modules + uses: actions/cache@v2 + with: + path: node_modules + key: cache-node-modules-${{ hashFiles('yarn.lock') }} + - name: Debug component name + env: + COMPONENT_NAME: ${{ matrix.component }} + run: echo ${COMPONENT_NAME} + - name: 'Build images' + run: | + + npx nx container ${COMPONENT_NAME} --prod + env: + INPUT_PUSH: false + COMPONENT_NAME: ${{ matrix.component }} diff --git a/apps/vc-api/Dockerfile b/apps/vc-api/Dockerfile new file mode 100644 index 0000000..9afd7eb --- /dev/null +++ b/apps/vc-api/Dockerfile @@ -0,0 +1,33 @@ +# Stage 1: Install dependencies in a separate layer to leverage Docker cache +FROM node:lts-alpine as deps +WORKDIR /usr/src/app +COPY dist/apps/vc-api/package.json dist/apps/vc-api/yarn.lock ./ +RUN apk add --no-cache --virtual .build-deps python3 make g++ && \ + echo "@community http://dl-cdn.alpinelinux.org/alpine/v3.18/community" >> /etc/apk/repositories && \ + yarn install --production && \ + apk del .build-deps + +# Stage 2: Build the application +# Note: Assuming main.js doesn't require a build process. If it does, you would need to copy source files and build here. +FROM node:lts-alpine as build +WORKDIR /usr/src/app +COPY --from=deps /usr/src/app/node_modules ./node_modules +COPY dist/apps/vc-api/ ./ + +# Stage 3: Production image, copy all the files and run the app +FROM node:lts-alpine as runner +RUN apk add --no-cache dumb-init && \ + addgroup -S appgroup && adduser -S appuser -G appgroup +ENV NODE_ENV production +ENV PORT 3009 + +WORKDIR /usr/src/app +# Copy only necessary runtime files +COPY --from=build /usr/src/app/ ./ +COPY --from=build /usr/src/app/node_modules ./node_modules + +# Use non-root user for better security +USER appuser + +EXPOSE 3009 +CMD [ "npm", "run", "start" ] diff --git a/apps/vc-api/package.json b/apps/vc-api/package.json index 2c63c08..61acca5 100644 --- a/apps/vc-api/package.json +++ b/apps/vc-api/package.json @@ -1,2 +1,24 @@ { + "scripts": { + "start": "node main.js" + }, + "dependencies": { + "@nestjs/axios": "^3.0.3", + "@nestjs/common": "^10.0.2", + "@nestjs/config": "^3.2.3", + "@nestjs/core": "^10.0.2", + "@nestjs/platform-express": "^10.0.2", + "@nx/webpack": "19.7.2", + "@veramo/core": "^6.0.0", + "@veramo/credential-eip712": "^6.0.0", + "class-transformer": "^0.5.1", + "class-validator": "^0.14.1", + "did-resolver": "4.1.0", + "ens-did-resolver": "^1.0.4", + "ethers": "^6.13.2", + "ethr-did-resolver": "^10.1.10", + "express": "4.20.0", + "moment": "^2.30.1", + "web-did-resolver": "^2.0.27" + } } diff --git a/apps/vc-api/project.json b/apps/vc-api/project.json index f84a638..0965529 100644 --- a/apps/vc-api/project.json +++ b/apps/vc-api/project.json @@ -22,7 +22,7 @@ "development": {}, "production": {} }, - "dependsOn": ["prisma-generate","lint","^test","test"] + "dependsOn": ["lint"] }, "serve": { "executor": "@nx/js:node", @@ -44,6 +44,27 @@ "options": { "fix": true } + }, + "container": { + "executor": "@nx-tools/nx-container:build", + "dependsOn": ["build"], + "options": { + "engine": "docker", + "metadata": { + "images": ["justaname/vc-api"], + "load": true, + "tags": [ + "type=schedule", + "type=ref,event=branch", + "type=ref,event=tag", + "type=ref,event=pr", + "type=semver,pattern={{version}}", + "type=semver,pattern={{major}}.{{minor}}", + "type=semver,pattern={{major}}", + "type=sha,prefix=sha-" + ] + } + } } } } diff --git a/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/abstract.subject.resolver.ts b/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/abstract.subject.resolver.ts index ed55e99..a26f80b 100644 --- a/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/abstract.subject.resolver.ts +++ b/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/abstract.subject.resolver.ts @@ -8,6 +8,7 @@ import { TimeGenerator } from '../../../../time.generator'; import { AllCallback } from './callback/all.callback'; import { IEnvironmentGetter } from '../../../../environment/ienvironment.getter'; +/* eslint-disable @typescript-eslint/ban-types */ export abstract class AbstractSubjectResolver { credentialCreator: ICredentialCreator; @@ -40,7 +41,6 @@ export abstract class AbstractSubjectResolver { - console.log("Callback data", data); if (this.checkCallbackParametersHaveAllRequiredFields(data)) { return this.callbackSuccessful(data); } else { diff --git a/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/discord.subject.resolver.ts b/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/discord.subject.resolver.ts index 43e0547..b98664e 100644 --- a/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/discord.subject.resolver.ts +++ b/apps/vc-api/src/core/applications/credentials/facade/subjects-resolvers/subjects/discord.subject.resolver.ts @@ -84,10 +84,7 @@ export class DiscordSubjectResolver extends AbstractSubjectResolver; +/* eslint-disable @typescript-eslint/ban-types */ export class EthereumEip712Signature2021 { credentialSubject: CredentialSubject & T; issuanceDate: Date; diff --git a/apps/vc-api/src/external/credentails/credential.agent.ts b/apps/vc-api/src/external/credentails/credential.agent.ts index c42db5f..48c9ed1 100644 --- a/apps/vc-api/src/external/credentails/credential.agent.ts +++ b/apps/vc-api/src/external/credentails/credential.agent.ts @@ -35,7 +35,6 @@ export class CredentialAgent implements ICredentialCreator, ICredentialVerifier, } async createCredential(credential: EthereumEip712Signature2021): Promise { - console.debug('Creating credential', credential) const verifiedCredential = await this.agent.createVerifiableCredentialEIP712( this.credentialAgentMapper.mapEthereumEip712Signature2021ToVeramoICreateVerifiableCredentialEIP712Args(this.identifier.did,credential) ) diff --git a/k8s-staging/staging-secrets.yaml b/k8s-staging/staging-secrets.yaml new file mode 100644 index 0000000..924634b --- /dev/null +++ b/k8s-staging/staging-secrets.yaml @@ -0,0 +1,77 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: secrets-manager-access-sa + namespace: verifications-staging-namespace + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::905418196669:role/justaname-staging-cluster-eksClusterRole +--- +apiVersion: secrets-store.csi.x-k8s.io/v1 +kind: SecretProviderClass +metadata: + name: aws-secrets + namespace: verifications-staging-namespace + annotations: + last-modified: "2024-04-04" +spec: + provider: aws + secretObjects: + - secretName: foosecret-verifications + type: Opaque + data: + - objectName: infura_project_id + key: INFURA_PROJECT_ID + - objectName: signing_private_key + key: SIGNING_PRIVATE_KEY + - objectName: environment + key: ENVIRONMENT + - objectName: api_domain + key: API_DOMAIN + - objectName: github_client_id + key: GITHUB_CLIENT_ID + - objectName: github_client_secret + key: GITHUB_CLIENT_SECRET + - objectName: twitter_client_id + key: TWITTER_CLIENT_ID + - objectName: twitter_client_secret + key: TWITTER_CLIENT_SECRET + - objectName: telegram_bot_token + key: TELEGRAM_BOT_TOKEN + - objectName: telegram_bot_username + key: TELEGRAM_BOT_USERNAME + - objectName: discord_client_id + key: DISCORD_CLIENT_ID + - objectName: discord_client_secret + key: DISCORD_CLIENT_SECRET + + + parameters: + region: eu-central-1 + objects: | + - objectName: "justaname-staging-verifications-env-var" + objectType: "secretsmanager" + jmesPath: + - path: INFURA_PROJECT_ID + objectAlias: infura_project_id + - path: SIGNING_PRIVATE_KEY + objectAlias: signing_private_key + - path: ENVIRONMENT + objectAlias: environment + - path: API_DOMAIN + objectAlias: api_domain + - path: GITHUB_CLIENT_ID + objectAlias: github_client_id + - path: GITHUB_CLIENT_SECRET + objectAlias: github_client_secret + - path: TWITTER_CLIENT_ID + objectAlias: twitter_client_id + - path: TWITTER_CLIENT_SECRET + objectAlias: twitter_client_secret + - path: TELEGRAM_BOT_TOKEN + objectAlias: telegram_bot_token + - path: TELEGRAM_BOT_USERNAME + objectAlias: telegram_bot_username + - path: DISCORD_CLIENT_ID + objectAlias: discord_client_id + - path: DISCORD_CLIENT_SECRET + objectAlias: discord_client_secret diff --git a/k8s-staging/vc-api-deployment.yaml b/k8s-staging/vc-api-deployment.yaml new file mode 100644 index 0000000..ad10bbc --- /dev/null +++ b/k8s-staging/vc-api-deployment.yaml @@ -0,0 +1,108 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vc-api-deployment + labels: + app: analytics + namespace: verifications-staging-namespace +spec: + selector: + matchLabels: + app: vc-api + replicas: 1 + template: + metadata: + labels: + app: vc-api + spec: + serviceAccountName: secrets-manager-access-sa + volumes: + - name: secrets-store-inline + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: "aws-secrets" + containers: + - name: analytics + image: 905418196669.dkr.ecr.eu-central-1.amazonaws.com/justaname/vc-api:latest + ports: + - containerPort: 3009 + volumeMounts: + - mountPath: "/mnt/secrets-store" + name: secrets-store-inline + readOnly: true + env: + - name: INFURA_PROJECT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: INFURA_PROJECT_ID + - name: SIGNING_PRIVATE_KEY + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: SIGNING_PRIVATE_KEY + - name: ENVIRONMENT + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: ENVIRONMENT + - name: API_DOMAIN + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: API_DOMAIN + - name: GITHUB_CLIENT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: GITHUB_CLIENT_ID + - name: GITHUB_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: GITHUB_CLIENT_SECRET + - name: TWITTER_CLIENT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TWITTER_CLIENT_ID + - name: TWITTER_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TWITTER_CLIENT_SECRET + - name: TELEGRAM_BOT_TOKEN + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TELEGRAM_BOT_TOKEN + - name: TELEGRAM_BOT_USERNAME + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TELEGRAM_BOT_USERNAME + - name: DISCORD_CLIENT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: DISCORD_CLIENT_ID + - name: DISCORD_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: DISCORD_CLIENT_SECRET +--- +apiVersion: v1 +kind: Service +metadata: + name: vc-api-service + namespace: verifications-staging-namespace +spec: + selector: + app: vc-api + ports: + - port: 3009 + targetPort: 3009 + type: ClusterIP diff --git a/k8s/secrets.yaml b/k8s/secrets.yaml new file mode 100644 index 0000000..9023cbb --- /dev/null +++ b/k8s/secrets.yaml @@ -0,0 +1,77 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: secrets-manager-access-sa + namespace: verifications-namespace + annotations: + eks.amazonaws.com/role-arn: arn:aws:iam::905418196669:role/justaname-cluster-eksClusterRole +--- +apiVersion: secrets-store.csi.x-k8s.io/v1 +kind: SecretProviderClass +metadata: + name: aws-secrets + namespace: verifications-namespace + annotations: + last-modified: "2024-04-04" +spec: + provider: aws + secretObjects: + - secretName: foosecret-verifications + type: Opaque + data: + - objectName: infura_project_id + key: INFURA_PROJECT_ID + - objectName: signing_private_key + key: SIGNING_PRIVATE_KEY + - objectName: environment + key: ENVIRONMENT + - objectName: api_domain + key: API_DOMAIN + - objectName: github_client_id + key: GITHUB_CLIENT_ID + - objectName: github_client_secret + key: GITHUB_CLIENT_SECRET + - objectName: twitter_client_id + key: TWITTER_CLIENT_ID + - objectName: twitter_client_secret + key: TWITTER_CLIENT_SECRET + - objectName: telegram_bot_token + key: TELEGRAM_BOT_TOKEN + - objectName: telegram_bot_username + key: TELEGRAM_BOT_USERNAME + - objectName: discord_client_id + key: DISCORD_CLIENT_ID + - objectName: discord_client_secret + key: DISCORD_CLIENT_SECRET + + + parameters: + region: eu-central-1 + objects: | + - objectName: "justaname-verifications-env-var" + objectType: "secretsmanager" + jmesPath: + - path: INFURA_PROJECT_ID + objectAlias: infura_project_id + - path: SIGNING_PRIVATE_KEY + objectAlias: signing_private_key + - path: ENVIRONMENT + objectAlias: environment + - path: API_DOMAIN + objectAlias: api_domain + - path: GITHUB_CLIENT_ID + objectAlias: github_client_id + - path: GITHUB_CLIENT_SECRET + objectAlias: github_client_secret + - path: TWITTER_CLIENT_ID + objectAlias: twitter_client_id + - path: TWITTER_CLIENT_SECRET + objectAlias: twitter_client_secret + - path: TELEGRAM_BOT_TOKEN + objectAlias: telegram_bot_token + - path: TELEGRAM_BOT_USERNAME + objectAlias: telegram_bot_username + - path: DISCORD_CLIENT_ID + objectAlias: discord_client_id + - path: DISCORD_CLIENT_SECRET + objectAlias: discord_client_secret diff --git a/k8s/vc-api-deployment.yaml b/k8s/vc-api-deployment.yaml new file mode 100644 index 0000000..bb9357e --- /dev/null +++ b/k8s/vc-api-deployment.yaml @@ -0,0 +1,108 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vc-api-deployment + labels: + app: analytics + namespace: verifications-namespace +spec: + selector: + matchLabels: + app: vc-api + replicas: 1 + template: + metadata: + labels: + app: vc-api + spec: + serviceAccountName: secrets-manager-access-sa + volumes: + - name: secrets-store-inline + csi: + driver: secrets-store.csi.k8s.io + readOnly: true + volumeAttributes: + secretProviderClass: "aws-secrets" + containers: + - name: analytics + image: 905418196669.dkr.ecr.eu-central-1.amazonaws.com/justaname-production/vc-api:latest + ports: + - containerPort: 3009 + volumeMounts: + - mountPath: "/mnt/secrets-store" + name: secrets-store-inline + readOnly: true + env: + - name: INFURA_PROJECT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: INFURA_PROJECT_ID + - name: SIGNING_PRIVATE_KEY + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: SIGNING_PRIVATE_KEY + - name: ENVIRONMENT + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: ENVIRONMENT + - name: API_DOMAIN + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: API_DOMAIN + - name: GITHUB_CLIENT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: GITHUB_CLIENT_ID + - name: GITHUB_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: GITHUB_CLIENT_SECRET + - name: TWITTER_CLIENT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TWITTER_CLIENT_ID + - name: TWITTER_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TWITTER_CLIENT_SECRET + - name: TELEGRAM_BOT_TOKEN + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TELEGRAM_BOT_TOKEN + - name: TELEGRAM_BOT_USERNAME + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: TELEGRAM_BOT_USERNAME + - name: DISCORD_CLIENT_ID + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: DISCORD_CLIENT_ID + - name: DISCORD_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: foosecret-verifications + key: DISCORD_CLIENT_SECRET +--- +apiVersion: v1 +kind: Service +metadata: + name: vc-api-service + namespace: verifications-namespace +spec: + selector: + app: vc-api + ports: + - port: 3009 + targetPort: 3009 + type: ClusterIP diff --git a/package.json b/package.json index a10cdc2..f3359c3 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "@nestjs/config": "^3.2.3", "@nestjs/core": "^10.0.2", "@nestjs/platform-express": "^10.0.2", + "@nx-tools/container-metadata": "^6.0.2", "@veramo/core": "^6.0.0", "@veramo/credential-eip712": "^6.0.0", "@veramo/credential-ld": "^6.0.0", diff --git a/yarn.lock b/yarn.lock index d2f3443..69f5928 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,7 +9,25 @@ dependencies: "@actions/io" "^1.0.1" -"@actions/io@^1.0.1": +"@actions/github@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@actions/github/-/github-6.0.0.tgz#65883433f9d81521b782a64cc1fd45eef2191ea7" + integrity sha512-alScpSVnYmjNEXboZjarjukQEzgCRmjMv6Xj47fsdnqGS73bjJNDpiiXmp8jr0UZLdUB6d9jW63IcmddUP+l0g== + dependencies: + "@actions/http-client" "^2.2.0" + "@octokit/core" "^5.0.1" + "@octokit/plugin-paginate-rest" "^9.0.0" + "@octokit/plugin-rest-endpoint-methods" "^10.0.0" + +"@actions/http-client@^2.2.0": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-2.2.3.tgz#31fc0b25c0e665754ed39a9f19a8611fc6dab674" + integrity sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA== + dependencies: + tunnel "^0.0.6" + undici "^5.25.4" + +"@actions/io@^1.0.1", "@actions/io@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.1.3.tgz#4cdb6254da7962b07473ff5c335f3da485d94d71" integrity sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q== @@ -1047,6 +1065,14 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== +"@babel/runtime-corejs3@^7.12.1": + version "7.25.6" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.25.6.tgz#5e3facf42775cc95bcde95746e940061931286e4" + integrity sha512-Gz0Nrobx8szge6kQQ5Z5MX9L3ObqNwCQY1PSwSNzreFL7aHGxv8Fp2j3ETV6/wWdbiV+mW6OSm8oQhg3Tcsniw== + dependencies: + core-js-pure "^3.30.2" + regenerator-runtime "^0.14.0" + "@babel/runtime@^7.22.6", "@babel/runtime@^7.7.2", "@babel/runtime@^7.8.4": version "7.25.6" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.25.6.tgz#9afc3289f7184d8d7f98b099884c26317b9264d2" @@ -2260,6 +2286,30 @@ consola "^2.15.0" node-fetch "^2.6.1" +"@nx-tools/ci-context@6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@nx-tools/ci-context/-/ci-context-6.0.1.tgz#fc28f2a3c4c3e019ac56cd3b1b3f3b8b95a74d17" + integrity sha512-+nZqVr6rZvSpqqbf9cZkiwvpixPx7EjJWAbIixueclakyYU8okZ20wVy30wd4wOmcnOcb4VxCdSAY4AqsUgseg== + dependencies: + "@actions/github" "^6.0.0" + "@nx-tools/core" "6.0.1" + "@octokit/openapi-types" "^22.0.0" + ci-info "^4.0.0" + properties-file "^3.5.4" + +"@nx-tools/container-metadata@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@nx-tools/container-metadata/-/container-metadata-6.0.2.tgz#4b8b574bb6b3ef222858ce7f93dc09b2f041dbd9" + integrity sha512-jAad8dEPaRX6SKvvTo6uIcPphD2ZEOuERtx0jb1YTxU7J7+1SF9wv+Em+7Xx3G08QJfnrNV8ZVoVaHWqFs7gqw== + dependencies: + "@nx-tools/ci-context" "6.0.1" + "@nx-tools/core" "6.0.1" + "@renovate/pep440" "1.0.0" + csv-parse "^5.5.5" + handlebars "^4.7.8" + moment-timezone "^0.5.45" + semver "^7.6.0" + "@nx-tools/core@5.3.1": version "5.3.1" resolved "https://registry.yarnpkg.com/@nx-tools/core/-/core-5.3.1.tgz#61039d6c1d01bf646580de2cdb6cd69d4cdca6eb" @@ -2269,6 +2319,17 @@ chalk "^4.1.2" ci-info "^3.8.0" +"@nx-tools/core@6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@nx-tools/core/-/core-6.0.1.tgz#d1417bc43417659fad4a166f1b16e6fc749e4be9" + integrity sha512-Uj0H5XWmOj60rTuRGe4JO6z0nO9sDZ76xrZJKkityWQl7KYjAM8KYIK4jbIgq9GdumK1pTAqv8GnzWNe15Uixw== + dependencies: + "@actions/exec" "^1.1.1" + "@actions/io" "^1.1.3" + chalk "^4.1.2" + ci-info "^4.0.0" + csv-parse "^5.5.5" + "@nx-tools/nx-container@^5.2.0": version "5.3.1" resolved "https://registry.yarnpkg.com/@nx-tools/nx-container/-/nx-container-5.3.1.tgz#bad9f5731992fbf71032ce23e6c179a80a54bfe5" @@ -2570,6 +2631,98 @@ tslib "^2.3.0" yargs-parser "21.1.1" +"@octokit/auth-token@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-4.0.0.tgz#40d203ea827b9f17f42a29c6afb93b7745ef80c7" + integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA== + +"@octokit/core@^5.0.1": + version "5.2.0" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.2.0.tgz#ddbeaefc6b44a39834e1bb2e58a49a117672a7ea" + integrity sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg== + dependencies: + "@octokit/auth-token" "^4.0.0" + "@octokit/graphql" "^7.1.0" + "@octokit/request" "^8.3.1" + "@octokit/request-error" "^5.1.0" + "@octokit/types" "^13.0.0" + before-after-hook "^2.2.0" + universal-user-agent "^6.0.0" + +"@octokit/endpoint@^9.0.1": + version "9.0.5" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-9.0.5.tgz#e6c0ee684e307614c02fc6ac12274c50da465c44" + integrity sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw== + dependencies: + "@octokit/types" "^13.1.0" + universal-user-agent "^6.0.0" + +"@octokit/graphql@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-7.1.0.tgz#9bc1c5de92f026648131f04101cab949eeffe4e0" + integrity sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ== + dependencies: + "@octokit/request" "^8.3.0" + "@octokit/types" "^13.0.0" + universal-user-agent "^6.0.0" + +"@octokit/openapi-types@^20.0.0": + version "20.0.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-20.0.0.tgz#9ec2daa0090eeb865ee147636e0c00f73790c6e5" + integrity sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA== + +"@octokit/openapi-types@^22.0.0", "@octokit/openapi-types@^22.2.0": + version "22.2.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-22.2.0.tgz#75aa7dcd440821d99def6a60b5f014207ae4968e" + integrity sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg== + +"@octokit/plugin-paginate-rest@^9.0.0": + version "9.2.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.2.1.tgz#2e2a2f0f52c9a4b1da1a3aa17dabe3c459b9e401" + integrity sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw== + dependencies: + "@octokit/types" "^12.6.0" + +"@octokit/plugin-rest-endpoint-methods@^10.0.0": + version "10.4.1" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-10.4.1.tgz#41ba478a558b9f554793075b2e20cd2ef973be17" + integrity sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg== + dependencies: + "@octokit/types" "^12.6.0" + +"@octokit/request-error@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-5.1.0.tgz#ee4138538d08c81a60be3f320cd71063064a3b30" + integrity sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q== + dependencies: + "@octokit/types" "^13.1.0" + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^8.3.0", "@octokit/request@^8.3.1": + version "8.4.0" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-8.4.0.tgz#7f4b7b1daa3d1f48c0977ad8fffa2c18adef8974" + integrity sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw== + dependencies: + "@octokit/endpoint" "^9.0.1" + "@octokit/request-error" "^5.1.0" + "@octokit/types" "^13.1.0" + universal-user-agent "^6.0.0" + +"@octokit/types@^12.6.0": + version "12.6.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-12.6.0.tgz#8100fb9eeedfe083aae66473bd97b15b62aedcb2" + integrity sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw== + dependencies: + "@octokit/openapi-types" "^20.0.0" + +"@octokit/types@^13.0.0", "@octokit/types@^13.1.0": + version "13.5.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-13.5.0.tgz#4796e56b7b267ebc7c921dcec262b3d5bfb18883" + integrity sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ== + dependencies: + "@octokit/openapi-types" "^22.2.0" + "@peculiar/asn1-schema@^2.3.8": version "2.3.13" resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.3.13.tgz#ec8509cdcbc0da3abe73fd7e690556b57a61b8f4" @@ -2609,6 +2762,13 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== +"@renovate/pep440@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@renovate/pep440/-/pep440-1.0.0.tgz#9e05cac649b6a3d027cba7f2939b085de78f39ea" + integrity sha512-k3pZVxGEGpU7rpH507/9vxfFjuxX7qx4MSj9Fk+6zBsf/uZmAy8x97dNtZacbge7gP9TazbW1d7SEb5vsOmKlw== + dependencies: + xregexp "4.4.1" + "@rollup/plugin-babel@^6.0.4": version "6.0.4" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-6.0.4.tgz#bd698e351fa9aa9619fcae780aea2a603d98e4c4" @@ -4535,6 +4695,11 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== +before-after-hook@^2.2.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" + integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== + big-integer@^1.6.48: version "1.6.52" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" @@ -4838,6 +5003,11 @@ ci-info@^3.2.0, ci-info@^3.8.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== +ci-info@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.0.0.tgz#65466f8b280fc019b9f50a5388115d17a63a44f2" + integrity sha512-TdHqgGf9odd8SXNuxtUBVx8Nv+qZOejE6qyqiy5NtbYYQOeFa6zmHkxlPzmaLxWWHsU6nJmB7AETdVPi+2NBUg== + cipher-base@^1.0.1, cipher-base@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" @@ -5154,6 +5324,11 @@ core-js-compat@^3.37.1, core-js-compat@^3.38.0: dependencies: browserslist "^4.23.3" +core-js-pure@^3.30.2: + version "3.38.1" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.38.1.tgz#e8534062a54b7221344884ba9b52474be495ada3" + integrity sha512-BY8Etc1FZqdw1glX0XNOq2FDwfrg/VGqoZOZCdaL+UmdaqDwQwYXkMJT4t6In+zfEfOJDcM9T0KdbBeJg8KKCQ== + core-util-is@^1.0.3, core-util-is@~1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" @@ -5483,7 +5658,7 @@ csso@^5.0.5: dependencies: css-tree "~2.2.0" -csv-parse@^5.4.0: +csv-parse@^5.4.0, csv-parse@^5.5.5: version "5.5.6" resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.5.6.tgz#0d726d58a60416361358eec291a9f93abe0b6b1a" integrity sha512-uNpm30m/AGSkLxxy7d9yRXpJQFrZzVWLFBkS+6ngPcZkw/5k3L/jjFuj7tVnEpRn+QgmiXr21nDlhCiUK4ij2A== @@ -5608,6 +5783,11 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== +deprecation@^2.0.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + destroy@1.2.0, destroy@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" @@ -6826,7 +7006,7 @@ handle-thing@^2.0.0: resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== -handlebars@^4.7.7: +handlebars@^4.7.7, handlebars@^4.7.8: version "4.7.8" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== @@ -8558,7 +8738,14 @@ mkdirp@^2.1.3: resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== -moment@^2.30.1: +moment-timezone@^0.5.45: + version "0.5.45" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.45.tgz#cb685acd56bac10e69d93c536366eb65aa6bcf5c" + integrity sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ== + dependencies: + moment "^2.29.4" + +moment@^2.29.4, moment@^2.30.1: version "2.30.1" resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== @@ -9714,6 +9901,11 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +properties-file@^3.5.4: + version "3.5.7" + resolved "https://registry.yarnpkg.com/properties-file/-/properties-file-3.5.7.tgz#8d3ee6234e4948da7939580bec838dcf52cac4ae" + integrity sha512-f47I5uaVJJnE3KilDi9vfXT6Bc/6rrRgsJ8L55CUcalnsurxG+jwkGzAAqvyXDixK+ejzvO80Q8OngwDWErk3Q== + protons-runtime@^5.4.0: version "5.5.0" resolved "https://registry.yarnpkg.com/protons-runtime/-/protons-runtime-5.5.0.tgz#ea06d9ef843aad77ea5de3e1ebafa81b58c24570" @@ -10994,6 +11186,11 @@ tsscmp@1.0.6: resolved "https://registry.yarnpkg.com/tsscmp/-/tsscmp-1.0.6.tgz#85b99583ac3589ec4bfef825b5000aa911d605eb" integrity sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA== +tunnel@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c" + integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg== + tweetnacl@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" @@ -11123,7 +11320,7 @@ undici-types@~6.19.2: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== -undici@^5.21.2: +undici@^5.21.2, undici@^5.25.4: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== @@ -11160,6 +11357,11 @@ union@~0.5.0: dependencies: qs "^6.4.0" +universal-user-agent@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.1.tgz#15f20f55da3c930c57bddbf1734c6654d5fd35aa" + integrity sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ== + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -11545,6 +11747,13 @@ ws@^8.18.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== +xregexp@4.4.1: + version "4.4.1" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.4.1.tgz#c84a88fa79e9ab18ca543959712094492185fe65" + integrity sha512-2u9HwfadaJaY9zHtRRnH6BY6CQVNQKkYm3oLtC9gJXXzfsbACg5X5e4EZZGVAH+YIfa+QA9lsFQTTe3HURF3ag== + dependencies: + "@babel/runtime-corejs3" "^7.12.1" + xtend@^4.0.0: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" From 027b5a47b7e3d74997937d494400a75ffe25bfdb Mon Sep 17 00:00:00 2001 From: Ghadi Mhawej Date: Thu, 12 Sep 2024 20:19:52 +0300 Subject: [PATCH 3/5] fix: added gh token in gh workflow --- .github/workflows/ci-on-develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-on-develop.yml b/.github/workflows/ci-on-develop.yml index 6cf7e2f..737604a 100644 --- a/.github/workflows/ci-on-develop.yml +++ b/.github/workflows/ci-on-develop.yml @@ -87,3 +87,4 @@ jobs: env: INPUT_PUSH: false COMPONENT_NAME: ${{ matrix.component }} + INPUT_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} From 61e2a66b39f5f10992d2fc7b92ddb933b6a86dee Mon Sep 17 00:00:00 2001 From: Ghadi Mhawej Date: Fri, 13 Sep 2024 11:39:16 +0300 Subject: [PATCH 4/5] feat: staging and main github workflows --- .github/workflows/ci-on-main.yml | 104 ++++++++++++++++++++++++++++ .github/workflows/ci-on-staging.yml | 104 ++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+) create mode 100644 .github/workflows/ci-on-main.yml create mode 100644 .github/workflows/ci-on-staging.yml diff --git a/.github/workflows/ci-on-main.yml b/.github/workflows/ci-on-main.yml new file mode 100644 index 0000000..e744090 --- /dev/null +++ b/.github/workflows/ci-on-main.yml @@ -0,0 +1,104 @@ +name: ci-on-main + +on: + push: + branches: [ "main" ] + +jobs: + determine-affected-projects: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Cache node modules + id: cache + uses: actions/cache@v2 + with: + path: node_modules + key: cache-node-modules-${{ hashFiles('yarn.lock') }} + - uses: actions/setup-node@v1 + if: steps.cache.outputs.cache-hit != 'true' + with: + node-version: 18.18.0 + - name: yarn install + if: steps.cache.outputs.cache-hit != 'true' + continue-on-error: true + run: yarn install --pure-lockfile + + + - name: Fetch missing history + run: git fetch + + - name: 'Determine affected projects' + id: affected + run: | + OUTPUT=$(npx nx show projects --affected --base=origin/main~1 --head=origin/main --with-target=container) + echo "Affected projects: $OUTPUT" + OUTPUT="${OUTPUT//[$'\r\n']/ }" + echo "::set-output name=affected::$OUTPUT" + - name: Set output matrix excluding e2e + id: set-matrix + run: | + IFS=' ' + read -ra PROJECTS <<< "${{ steps.affected.outputs.affected }}" + COMPONENTS=() + for PROJECT in "${PROJECTS[@]}"; do + COMPONENTS+=("$PROJECT") + done + MATRIX='{"component":[' + for COMPONENT in "${COMPONENTS[@]}"; do + MATRIX+="\"$COMPONENT\"," + done + MATRIX="${MATRIX%,}]}" + echo "::set-output name=matrix::$MATRIX" + build_and_push: + needs: determine-affected-projects + runs-on: ubuntu-latest + if: ${{ needs.determine-affected-projects.outputs.matrix != '{"component":[]}' }} + strategy: + matrix: + component: ${{fromJson(needs.determine-affected-projects.outputs.matrix).component}} + steps: + - name: Debug affected projects + run: echo "${{ needs.determine-affected-projects.outputs.matrix }}" + + - name: Checkout code + uses: actions/checkout@v2 + - run: git fetch --no-tags --prune --depth=1 origin main + + - name: Cache node modules + uses: actions/cache@v2 + with: + path: node_modules + key: cache-node-modules-${{ hashFiles('yarn.lock') }} + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Debug component name + env: + COMPONENT_NAME: ${{ matrix.component }} + run: echo ${COMPONENT_NAME} + - name: 'Build images' + run: | + + npx nx container ${COMPONENT_NAME} --prod + env: + COMPONENT_NAME: ${{ matrix.component }} + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + INPUT_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + INPUT_VC_API_IMAGES: ${{ steps.login-ecr.outputs.registry }}/justaname-production/vc-api + INPUT_TAGS: latest + INPUT_PUSH: true diff --git a/.github/workflows/ci-on-staging.yml b/.github/workflows/ci-on-staging.yml new file mode 100644 index 0000000..b48bf66 --- /dev/null +++ b/.github/workflows/ci-on-staging.yml @@ -0,0 +1,104 @@ +name: ci-on-staging + +on: + push: + branches: [ "staging" ] + +jobs: + determine-affected-projects: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Cache node modules + id: cache + uses: actions/cache@v2 + with: + path: node_modules + key: cache-node-modules-${{ hashFiles('yarn.lock') }} + - uses: actions/setup-node@v1 + if: steps.cache.outputs.cache-hit != 'true' + with: + node-version: 18.18.0 + - name: yarn install + if: steps.cache.outputs.cache-hit != 'true' + continue-on-error: true + run: yarn install --pure-lockfile + + + - name: Fetch missing history + run: git fetch + + - name: 'Determine affected projects' + id: affected + run: | + OUTPUT=$(npx nx show projects --affected --base=origin/staging~1 --head=origin/staging --with-target=container) + echo "Affected projects: $OUTPUT" + OUTPUT="${OUTPUT//[$'\r\n']/ }" + echo "::set-output name=affected::$OUTPUT" + - name: Set output matrix + id: set-matrix + run: | + IFS=' ' + read -ra PROJECTS <<< "${{ steps.affected.outputs.affected }}" + COMPONENTS=() + for PROJECT in "${PROJECTS[@]}"; do + COMPONENTS+=("$PROJECT") + done + MATRIX='{"component":[' + for COMPONENT in "${COMPONENTS[@]}"; do + MATRIX+="\"$COMPONENT\"," + done + MATRIX="${MATRIX%,}]}" + echo "::set-output name=matrix::$MATRIX" + build_and_push: + needs: determine-affected-projects + runs-on: ubuntu-latest + if: ${{ needs.determine-affected-projects.outputs.matrix != '{"component":[]}' }} + strategy: + matrix: + component: ${{fromJson(needs.determine-affected-projects.outputs.matrix).component}} + steps: + - name: Debug affected projects + run: echo "${{ needs.determine-affected-projects.outputs.matrix }}" + + - name: Checkout code + uses: actions/checkout@v2 + - run: git fetch --no-tags --prune --depth=1 origin staging + + - name: Cache node modules + uses: actions/cache@v2 + with: + path: node_modules + key: cache-node-modules-${{ hashFiles('yarn.lock') }} + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-central-1 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v1 + + - name: Debug component name + env: + COMPONENT_NAME: ${{ matrix.component }} + run: echo ${COMPONENT_NAME} + - name: 'Build images' + run: | + + npx nx container ${COMPONENT_NAME} --prod + env: + COMPONENT_NAME: ${{ matrix.component }} + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + INPUT_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + INPUT_VC_API_IMAGES: ${{ steps.login-ecr.outputs.registry }}/justaname/vc-api + INPUT_TAGS: latest + INPUT_PUSH: true From b54eafda7291223e68b09704f980feb4d2297478 Mon Sep 17 00:00:00 2001 From: Ghadi Mhawej Date: Fri, 13 Sep 2024 12:23:21 +0300 Subject: [PATCH 5/5] fix: minor fixes --- apps/vc-api/package.json | 3 ++- apps/vc-api/src/api/auth/auth.callback.response.api.ts | 2 ++ apps/vc-api/src/api/auth/auth.controller.ts | 6 +++++- apps/vc-api/src/main.ts | 10 +++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/vc-api/package.json b/apps/vc-api/package.json index 61acca5..ed1aed4 100644 --- a/apps/vc-api/package.json +++ b/apps/vc-api/package.json @@ -19,6 +19,7 @@ "ethr-did-resolver": "^10.1.10", "express": "4.20.0", "moment": "^2.30.1", - "web-did-resolver": "^2.0.27" + "web-did-resolver": "^2.0.27", + "@nestjs/swagger": "^7.4.0" } } diff --git a/apps/vc-api/src/api/auth/auth.callback.response.api.ts b/apps/vc-api/src/api/auth/auth.callback.response.api.ts index a3c3d0d..a3f901d 100644 --- a/apps/vc-api/src/api/auth/auth.callback.response.api.ts +++ b/apps/vc-api/src/api/auth/auth.callback.response.api.ts @@ -124,6 +124,7 @@ export class ProofApiResponse { } @ApiExtraModels(CredentialSubjectApiResponse) +/* eslint-disable @typescript-eslint/ban-types */ export class EthereumEip712Signature2021ApiResponse { @ApiProperty({ type: CredentialSubjectApiResponse }) @ValidateNested() @@ -149,6 +150,7 @@ export class EthereumEip712Signature2021ApiResponse extends EthereumEip712Signature2021ApiResponse { @ApiProperty({ type: ProofApiResponse }) @ValidateNested() diff --git a/apps/vc-api/src/api/auth/auth.controller.ts b/apps/vc-api/src/api/auth/auth.controller.ts index 5593ced..fd1d15f 100644 --- a/apps/vc-api/src/api/auth/auth.controller.ts +++ b/apps/vc-api/src/api/auth/auth.controller.ts @@ -4,7 +4,6 @@ import { ICredentialCreatorFacade } from '../../core/applications/credentials/facade/icredential.facade'; import { Response } from 'express'; -import { VerifiedEthereumEip712Signature2021 } from '../../core/domain/entities/eip712'; import { AuthCallbackApiResponse } from './auth.callback.response.api'; import { AUTH_CONTROLLER_MAPPER, IAuthControllerMapper } from './mapper/iauth.controller.mapper'; import { AuthGetAuthUrlRequestApiRequestParam } from './auth.get-auth-url.request.api'; @@ -19,6 +18,11 @@ export class AuthController { private readonly authControllerMapper: IAuthControllerMapper ) {} + @Get('') + async welcomeToJustaNameVerifications(): Promise { + return ['Welcome to JustaName Verifications! Please use the /auth/:authName endpoint to get started.'] + } + @Get(':authName') async getAuthUrl( @Param() authGetAuthUrlRequestApi: AuthGetAuthUrlRequestApiRequestParam, diff --git a/apps/vc-api/src/main.ts b/apps/vc-api/src/main.ts index a93c0bd..4d1b2e2 100644 --- a/apps/vc-api/src/main.ts +++ b/apps/vc-api/src/main.ts @@ -13,6 +13,7 @@ import { } from '@nestjs/common'; import { VCManagementModule } from './vc-management.module'; import { NestExpressApplication } from '@nestjs/platform-express'; +import * as process from 'node:process'; async function bootstrap() { const app = await NestFactory.create( @@ -63,9 +64,12 @@ async function bootstrap() { const port = process.env.PORT || 3000; await app.listen(port); - Logger.log( - `🚀 Application is running on: http://localhost:${port}/${globalPrefix}/v${version}` - ); + + if (process.env.NODE_ENV === 'development') { + Logger.log( + `🚀 Application is running on: http://localhost:${port}/${globalPrefix}/v${version}` + ); + } } bootstrap();