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: ida auth sdk #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: ida auth sdk #49

wants to merge 1 commit into from

Conversation

naftis
Copy link
Contributor

@naftis naftis commented Jan 31, 2025

Implements the MOSIP IDA Auth SDK in Node.js for verifying the users details. This is a subset of the version featured in https://github.com/mosip/ida-auth-sdk/tree/release-0.9.x

To-do:

  • Instead of the demo input values, read the values from environment variables
  • Documentate / create placeholder values for the certs folder. This convention is copied from the ida-auth-sdk repository
  • Clarify the README's
  • Clarify what files are needed (keystore.p12 / ida-partner.crt)

@@ -14,6 +14,7 @@
},
"scripts": {
"dev": "turbo run dev",
"format": "prettier --write ."
"format": "prettier --write .",
"set-version": "node -e \"const fs=require('fs'),v=process.argv[1];['package.json',...fs.readdirSync('packages').map(d=>'packages/'+d+'/package.json')].forEach(f=>fs.writeFileSync(f,JSON.stringify({...require('./'+f),version:v},null,2)+'\\n'))\""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPT created helper for...

# bump package.json versions
yarn set-version 1.7.0-alpha.16

Comment on lines +7 to +18
"@fastify/formbody": "^8.0.1",
"@fastify/static": "^8.0.3",
"@types/node": "^22.4.1",
"@types/node-forge": "^1.3.11",
"casual": "^1.6.2",
"envalid": "^8.0.0",
"fastify": "^5.0.0",
"jose": "^5.9.6",
"jsonwebtoken": "^9.0.2",
"node-forge": "^1.3.1",
"tsx": "^4.19.2",
"typescript": "^5.6.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likely most are unneeded

Comment on lines +1 to +5
export const padBase64 = (str: string) =>
str + "=".repeat((4 - (str.length % 4)) % 4);

export const base64Encode = (input: string) =>
Buffer.from(input, "utf8").toString("base64url");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment what and why

consent: boolean;
}

export default class MOSIPAuthenticator {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's a class. Wanted to keep the implementation similar to ida-auth-sdk from mosip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant