Skip to content

feat: SSO support and clientcredentials based switchig for single sign on feature #1183

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

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from

Conversation

GHkrishna
Copy link
Contributor

@GHkrishna GHkrishna commented Apr 17, 2025

What

  • Support SSO
  • Ability to switch between client based on clientAlias instead of

sairanjit and others added 17 commits March 12, 2025 16:11
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>
* fix: added api param validations

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: removed unnecessary validations

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix:resolved validations issue

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* added comment on function for understanding

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: resolve orgid validations

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: added response message

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: added space in response messages

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

---------

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>
Signed-off-by: pallavighule <pallavi.ghule@ayanworks.com>
* fix: removed prisma commands in build stage

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* feat: create yml file for all services

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* Updated Dockerfiles

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* Updated yml to push docker images

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* updated yml files

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

---------

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>
* fix: used single yml file using matrix instead of multiple files

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* fix: renamed yml file to cicd.yml

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* fix: renamed yml file

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* fix: renamed yml file

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

* chore: removed id-token and attestations

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>

---------

Signed-off-by: sahil.kamble@ayanworks.com <sahil.kamble@ayanworks.com>
* chore: add aws into monorepo

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* chore: update tsconfig

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor:tsconfig.build.json file

Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>

* refactor: remove redundant .nvmrc file

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

---------

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: Tipu_Singh <tipu.singh@ayanworks.com>
Co-authored-by: Tipu_Singh <tipu.singh@ayanworks.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
* refactor: merge nats-interceptor into common

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor: merge repsonses lib into common

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor: create common function to handle errors

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* chore: add todo

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* fix: remove missed image service

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* fix: create separate function to handle common error

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* chore: add comment for the purpose of the functions

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* chore: update function comments

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

---------

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
* refactor: merge nats-interceptor into common

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor: merge repsonses lib into common

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor: create common function to handle errors

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* chore: add todo

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor: create common package in libs

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* fix: remove missed image service

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

* refactor: common service

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>

---------

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
* wip: support nested attributes while creating schema

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* wip: aligned issuance functionality with nested attributes structure

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: modify csv to json function

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: formatting changes

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: resolved sonar cloud issue

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: security hotspot issue

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* feat: added schema builder function

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: resolved issue

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: modify extract attributes function

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: destructured objects

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* feat: added description property

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

---------

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>
* wip: support nested attributes while creating schema

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* wip: aligned issuance functionality with nested attributes structure

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: modify csv to json function

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: formatting changes

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: resolved sonar cloud issue

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: security hotspot issue

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* feat: added schema builder function

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: resolved issue

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* refactor: modify extract attributes function

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: destructured objects

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* feat: added description property

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* fix: added validations for schema type

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* formatted enum file

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

* chore: added enum for indy schema data type

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>

---------

Signed-off-by: bhavanakarwade <bhavana.karwade@ayanworks.com>
…te and city (#1180)

* refactor: update organization API to support updation of country, state and city

Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>

* resolved sonarlint issues

Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>

* resolved sonarlint issues

Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>

---------

Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
Signed-off-by: pranalidhanavade <pranali.dhanavade@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
const encryptedToken = CryptoJS.AES.encrypt(JSON.stringify(clientCredential), process.env.CRYPTO_PRIVATE_KEY).toString();
const command = `${process.cwd()}/${scriptPath} ${dbUrl}`;

const { stdout, stderr } = await execPromise(command);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

Copilot Autofix

AI 5 days ago

To fix the issue, we will replace the use of execPromise with execFilePromise, which allows us to pass the command and its arguments separately. This approach avoids shell interpretation of the arguments, mitigating the risk of shell injection. Specifically:

  1. Extract the script path and arguments into separate variables.
  2. Use execFilePromise to execute the script, passing the script path as the command and the arguments as an array.
  3. Ensure that all inputs (e.g., scriptPath, dbUrl) are validated or sanitized before use.

The changes will be applied to both the importGeoLocationMasterData and updateClientCredential functions.


Suggested changeset 1
libs/prisma-service/prisma/seed.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/prisma-service/prisma/seed.ts b/libs/prisma-service/prisma/seed.ts
--- a/libs/prisma-service/prisma/seed.ts
+++ b/libs/prisma-service/prisma/seed.ts
@@ -403,5 +403,6 @@
 
-    const command = `${process.cwd()}/${scriptPath} ${dbUrl}`;
+    const scriptFullPath = `${process.cwd()}/${scriptPath}`;
+    const args = [dbUrl];
 
-    const { stdout, stderr } = await execPromise(command);
+    const { stdout, stderr } = await execPromise(scriptFullPath, args);
 
@@ -435,5 +436,6 @@
 
-    const command = `${process.cwd()}/${scriptPath} ${dbUrl} ${encryptedClientId} ${encryptedClientSecret}`;
+    const scriptFullPath = `${process.cwd()}/${scriptPath}`;
+    const args = [dbUrl, encryptedClientId, encryptedClientSecret];
 
-    const { stdout, stderr } = await execPromise(command);
+    const { stdout, stderr } = await execPromise(scriptFullPath, args);
 
EOF
@@ -403,5 +403,6 @@

const command = `${process.cwd()}/${scriptPath} ${dbUrl}`;
const scriptFullPath = `${process.cwd()}/${scriptPath}`;
const args = [dbUrl];

const { stdout, stderr } = await execPromise(command);
const { stdout, stderr } = await execPromise(scriptFullPath, args);

@@ -435,5 +436,6 @@

const command = `${process.cwd()}/${scriptPath} ${dbUrl} ${encryptedClientId} ${encryptedClientSecret}`;
const scriptFullPath = `${process.cwd()}/${scriptPath}`;
const args = [dbUrl, encryptedClientId, encryptedClientSecret];

const { stdout, stderr } = await execPromise(command);
const { stdout, stderr } = await execPromise(scriptFullPath, args);

Copilot is powered by AI and may make mistakes. Always verify output.
async function main(): Promise<void> {
const command = `${process.cwd()}/${scriptPath} ${dbUrl} ${encryptedClientId} ${encryptedClientSecret}`;

const { stdout, stderr } = await execPromise(command);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

Copilot Autofix

AI 5 days ago

To fix the issue, we will replace the use of execPromise with execFilePromise, which allows us to pass the command and its arguments separately. This approach avoids shell interpretation of the command string and mitigates the risk of shell injection. Specifically:

  1. Extract the script path and arguments into separate variables.
  2. Use execFilePromise to execute the script with the arguments passed as an array.
  3. Ensure that all inputs (e.g., scriptPath, dbUrl, encryptedClientId, encryptedClientSecret) are validated or sanitized before use.

Changes will be made to the updateClientCredential function in libs/prisma-service/prisma/seed.ts.


Suggested changeset 1
libs/prisma-service/prisma/seed.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/libs/prisma-service/prisma/seed.ts b/libs/prisma-service/prisma/seed.ts
--- a/libs/prisma-service/prisma/seed.ts
+++ b/libs/prisma-service/prisma/seed.ts
@@ -5,6 +5,6 @@
 import { CommonConstants } from '../../common/src/common.constant';
-import { exec } from 'child_process';
+import { execFile } from 'child_process';
 import * as util from 'util';
 import { encryptClientCredential } from '@credebl/common/cast.helper';
-const execPromise = util.promisify(exec);
+const execPromise = util.promisify(execFile);
 
@@ -435,5 +435,6 @@
 
-    const command = `${process.cwd()}/${scriptPath} ${dbUrl} ${encryptedClientId} ${encryptedClientSecret}`;
+    const scriptFullPath = `${process.cwd()}/${scriptPath}`;
+    const args = [dbUrl, encryptedClientId, encryptedClientSecret];
 
-    const { stdout, stderr } = await execPromise(command);
+    const { stdout, stderr } = await execPromise(scriptFullPath, args);
 
EOF
@@ -5,6 +5,6 @@
import { CommonConstants } from '../../common/src/common.constant';
import { exec } from 'child_process';
import { execFile } from 'child_process';
import * as util from 'util';
import { encryptClientCredential } from '@credebl/common/cast.helper';
const execPromise = util.promisify(exec);
const execPromise = util.promisify(execFile);

@@ -435,5 +435,6 @@

const command = `${process.cwd()}/${scriptPath} ${dbUrl} ${encryptedClientId} ${encryptedClientSecret}`;
const scriptFullPath = `${process.cwd()}/${scriptPath}`;
const args = [dbUrl, encryptedClientId, encryptedClientSecret];

const { stdout, stderr } = await execPromise(command);
const { stdout, stderr } = await execPromise(scriptFullPath, args);

Copilot is powered by AI and may make mistakes. Always verify output.
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
Signed-off-by: Krishna Waske <krishna.waske@ayanworks.com>
@GHkrishna GHkrishna changed the title feat: clientcredentials based switchig for single sign on feature feat: SSO support and clientcredentials based switchig for single sign on feature Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants