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

Authz temp #149

Merged
merged 28 commits into from
Aug 14, 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
11 changes: 11 additions & 0 deletions .deploy/SSL2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# secret.yaml
apiVersion: v1
kind: Secret

metadata:
name: entity-ssl-test
namespace: hypermine-development
type: kubernetes.io/tls
stringData:
tls.key: ""
tls.crt: ""
13 changes: 13 additions & 0 deletions .deploy/cert2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: entity-ssl-test
namespace: hypermine-development
spec:
dnsNames:
- api.entity-test.hypersign.id
- "*.api.entity-test.hypersign.id"
issuerRef:
kind: Issuer
name: letsencrypt-production
secretName: entity-ssl-test
12 changes: 9 additions & 3 deletions .deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ spec:

resources:
limits:
memory: "1Gi"
cpu: "500m"
memory: "2Gi"
cpu: "1000m"
ports:
- containerPort: __PORT__
env:
Expand Down Expand Up @@ -57,8 +57,14 @@ spec:
value: __MNEMONIC__
- name: JWT_SECRET
value: __JWT_SECRET__
- name: GLOBAL_TXN_CONTROLLER_QUEUE
value: __GLOBAL_TXN_CONTROLLER_QUEUE__
- name: RABBIT_MQ_URI
value: __RABBIT_MQ_URI__
- name: VAULT_PREFIX
value: __VAULT_PREFIX__
- name: WHITELISTED_CORS
value: "['https://entity.hypersign.id','https://api.entity.hypersign.id','https://wallet-prajna.hypersign.id']"
value: "['https://entity.hypersign.id','https://api.entity.hypersign.id','https://api.entity-test.hypersign.id','https://wallet-prajna.hypersign.id']"
volumeMounts:
- name: mongo
mountPath: "/data"
Expand Down
70 changes: 70 additions & 0 deletions .deploy/ingress2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: entity-ingress-test
namespace: hypermine-development
annotations:
kubernetes.io/ingress.allow-http: "false"
kubernetes.io/force-ssl-redirect: redirect
ingressClassName: "gce"
kubernetes.io/ingress.global-static-ip-name: entity-ip-test
cert-manager.io/issuer: letsencrypt-production
labels:
name: ingress

spec:
tls:
- secretName: entity-ssl-test
hosts:
- "api.entity-test.hypersign.id"
- "*.api.entity-test.hypersign.id"

rules:
- host: "api.entity-test.hypersign.id"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: entity-api-test-service
port:
number: 3001
- path: /ssi/
pathType: Prefix
backend:
service:
name: entity-api-test-service
port:
number: 3001
- path: /api/
pathType: Prefix
backend:
service:
name: entity-api-test-service
port:
number: 3001
- host: "*.api.entity-test.hypersign.id"
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: entity-api-test-service
port:
number: 3001
- path: /ssi/
pathType: Prefix
backend:
service:
name: entity-api-test-service
port:
number: 3001
- path: /api/
pathType: Prefix
backend:
service:
name: entity-api-test-service
port:
number: 3001
38 changes: 22 additions & 16 deletions .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,42 @@ jobs:
- name: "Configure kubectl"
run: gcloud container clusters get-credentials hypermine-gke --region=asia-south1
- name: Replace tags
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__PORT__/${{ secrets.PORT }}/g'' {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i ''s/__PORT__/${{ secrets.PORT }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__BASE_DB_PATH__#${{ secrets.BASE_DB_PATH }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__BASE_DB_PATH__#${{ secrets.BASE_DB_PATH }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__DB_CONFIG__#${{ secrets.DB_CONFIG }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__DB_CONFIG__#${{ secrets.DB_CONFIG }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__HID_NETWORK_RPC__#${{ secrets.HID_NETWORK_RPC }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__HID_NETWORK_RPC__#${{ secrets.HID_NETWORK_RPC }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__HID_NETWORK_API__#${{ secrets.HID_NETWORK_API }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__HID_NETWORK_API__#${{ secrets.HID_NETWORK_API }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__HID_NETWORK_NAMESPACE__#${{ secrets.HID_NETWORK_NAMESPACE }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__HID_NETWORK_NAMESPACE__#${{ secrets.HID_NETWORK_NAMESPACE }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__EDV_BASE_URL__#${{ secrets.EDV_BASE_URL }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__EDV_BASE_URL__#${{ secrets.EDV_BASE_URL }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__EDV_CONFIG_DIR__#${{ secrets.EDV_CONFIG_DIR }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__EDV_CONFIG_DIR__#${{ secrets.EDV_CONFIG_DIR }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__EDV_DID_FILE_PATH__#${{ secrets.EDV_DID_FILE_PATH }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__EDV_DID_FILE_PATH__#${{ secrets.EDV_DID_FILE_PATH }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__EDV_KEY_FILE_PATH__#${{ secrets.EDV_KEY_FILE_PATH }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__EDV_KEY_FILE_PATH__#${{ secrets.EDV_KEY_FILE_PATH }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__MNEMONIC__#${{ secrets.MNEMONIC }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__GLOBAL_TXN_CONTROLLER_QUEUE__#${{ secrets.GLOBAL_TXN_CONTROLLER_QUEUE }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__JWT_SECRET__#${{ secrets.JWT_SECRET }}#" {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__RABBIT_MQ_URI__#${{ secrets.RABBIT_MQ_URI }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__VAULT_PREFIX__#${{ secrets.VAULT_PREFIX }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_REPO__/${{ secrets.GOOGLE_ARTIFACT_REPO }}/g'' {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__MNEMONIC__#${{ secrets.MNEMONIC }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_PROJECT_ID__/${{ secrets.GOOGLE_PROJECT_ID }}/g'' {} \;
run: find .deploy/deployment2.yaml -type f -exec sed -i -e "s#__JWT_SECRET__#${{ secrets.JWT_SECRET }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment2.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment2.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_REPO__/${{ secrets.GOOGLE_ARTIFACT_REPO }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment2.yaml -type f -exec sed -i ''s/__GOOGLE_PROJECT_ID__/${{ secrets.GOOGLE_PROJECT_ID }}/g'' {} \;
- name: "Deploy to GKE"
run: kubectl apply -f .deploy/deployment.yaml
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/swagger": "^6.1.4",
"amqp-connection-manager": "^4.1.14",
"amqplib": "^0.10.4",
"argon2": "^0.30.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"express-session": "^1.17.3",
"fs": "^0.0.1-security",
"hid-hd-wallet": "git+https://github.com/hypersign-protocol/hid-hd-wallet.git#main",
"hs-ssi-sdk": "github:hypersign-protocol/hid-ssi-js-sdk#testcase/bjj",
"hypersign-edv-client": "github:hypersign-protocol/hypersign-edv-client#develop",
"hypersign-edv-client": "github:hypersign-protocol/hypersign-edv-client#deleteByDocumentId",
"idb-keyval": "^6.2.1",
"mongoose": "^6.8.3",
"passport": "^0.6.0",
Expand Down
2 changes: 2 additions & 0 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { DidModule } from './did/did.module';
import { SchemaModule } from './schema/schema.module';
import { CredentialModule } from './credential/credential.module';
import { PresentationModule } from './presentation/presentation.module';
import { TxSendModuleModule } from './tx-send-module/tx-send-module.module';
@Module({
imports: [
ConfigModule.forRoot({
Expand All @@ -18,6 +19,7 @@ import { PresentationModule } from './presentation/presentation.module';
SchemaModule,
CredentialModule,
PresentationModule,
TxSendModuleModule,
],
controllers: [],
providers: [{ provide: APP_FILTER, useClass: AllExceptionsFilter }],
Expand Down
3 changes: 2 additions & 1 deletion src/credential/credential.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import { WhitelistSSICorsMiddleware } from 'src/utils/middleware/cors.middleware
import { TrimMiddleware } from 'src/utils/middleware/trim.middleware';
import { credentialProviders } from './providers/credential.provider';
import { databaseProviders } from '../mongoose/tenant-mongoose-connections';
import { TxSendModuleModule } from 'src/tx-send-module/tx-send-module.module';

@Module({
imports: [EdvModule, HidWalletModule, DidModule],
imports: [EdvModule, HidWalletModule, DidModule, TxSendModuleModule],
controllers: [CredentialController],
providers: [
CredentialService,
Expand Down
Loading
Loading