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: relocation of ctype config #78

Merged
merged 15 commits into from
Mar 13, 2024
Merged

Conversation

aybarsayan
Copy link
Contributor

@aybarsayan aybarsayan commented Jan 31, 2024

fixes KILTProtocol/ticket#2911

The 'Ctype Hash' and 'Attester DID' have been moved to the .env file. Additionally, if a user does not specify one, it will automatically use the email ctype. A new ticket has been opened to list valid Ctype hashes in the readme.md file. See Ticket #3103.

How to test:

Please provide a brief step-by-step instruction.
If necessary provide information about dependencies (specific configuration, branches, database dumps, etc.)

  • Step 1
  • Step 2
  • etc.

Checklist:

  • I have verified that the code works
  • I have verified that the code is easy to understand
    • If not, I have left a well-balanced amount of inline comments
  • I have left the code in a better state
  • I have documented the changes (where applicable)
    • Either PR or Ticket to update the Docs
    • Link the PR/Ticket here

Copy link
Contributor

@rompemoldes rompemoldes left a comment

Choose a reason for hiding this comment

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

Mostly nice. Makes it easier.

Not so happy with the comments (code explainers) though. They are important because this is an educational project.

Support for both chains would also be nice, or at least say that by default it only works with SocialKYC on Peregrine.

.oldenv Outdated Show resolved Hide resolved
backend/src/config.ts Outdated Show resolved Hide resolved
backend/src/config.ts Outdated Show resolved Hide resolved
backend/src/config.ts Outdated Show resolved Hide resolved
backend/src/config.ts Outdated Show resolved Hide resolved
backend/src/credentials/listOfRequests.ts Outdated Show resolved Hide resolved
Comment on lines 5 to 4
// Here you can set which type of credential (cType) your dApp will request users to login.
// You can change it by importing a different one.
// The default is the Email CType by SocialKYC and SocialKYC as the Issuer
// Establish which cTypes our dApp accepts and which attesters we trust:

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that all this comments could go inside the variable explainer (docs) from requestedCTypeForLogin. Maybe a bit more structured and explaining how to change the imports.

backend/src/access/login.ts Show resolved Hide resolved
Comment on lines 10 to 19
const trustedAttestersValues = TRUSTED_ATTESTERS.split(',')
const requiredPropertiesValues = REQUIRED_PROPERTIES.split(',')

const requiredProperties = requiredPropertiesValues.map(
(requiredProperties) => requiredProperties
)

const trustedAttesters = trustedAttestersValues.map(
(trustedAttesters) => trustedAttesters as Kilt.DidUri
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const trustedAttestersValues = TRUSTED_ATTESTERS.split(',')
const requiredPropertiesValues = REQUIRED_PROPERTIES.split(',')
const requiredProperties = requiredPropertiesValues.map(
(requiredProperties) => requiredProperties
)
const trustedAttesters = trustedAttestersValues.map(
(trustedAttesters) => trustedAttesters as Kilt.DidUri
)
const trustedAttesters = TRUSTED_ATTESTERS.split(',') as Kilt.DidUri[]
const requiredProperties = REQUIRED_PROPERTIES.split(',')

backend/src/credentials/listOfRequests.ts Outdated Show resolved Hide resolved
Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

Nice added flexibility! There are few points that are not clear to me, that I'd like to get clarified.

backend/src/config.ts Outdated Show resolved Hide resolved
backend/src/config.ts Outdated Show resolved Hide resolved
.env.example Outdated Show resolved Hide resolved
backend/src/config.ts Outdated Show resolved Hide resolved
const trustedAttestersValues = TRUSTED_ATTESTERS.split(',')
const requiredPropertiesValues = REQUIRED_PROPERTIES.split(',')

const requiredProperties = requiredPropertiesValues.map(
Copy link
Member

Choose a reason for hiding this comment

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

What is this snippet of code doing exactly?

Copy link
Member

Choose a reason for hiding this comment

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

This comment still not addressed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was a experimental change to accept more than one TRUSTED_ATTESTERS which separated by a comma

Copy link
Member

@Dudleyneedham Dudleyneedham left a comment

Choose a reason for hiding this comment

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

Minor comment to remove the default.

README.md Outdated Show resolved Hide resolved
backend/src/credentials/ctypeRequest.ts Outdated Show resolved Hide resolved
Copy link
Member

@ntn-x2 ntn-x2 left a comment

Choose a reason for hiding this comment

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

Please resolve any conflicts with the base branch, and gather an approval from @kilted-andres.

Comment on lines 9 to 14
const trustedAttesters = TRUSTED_ATTESTERS.split(',').map((s)=> {
const trimmed = s.trim()
Kilt.Did.validateUri(trimmed)
return trimmed as Kilt.DidUri
})
const requiredProperties = REQUIRED_PROPERTIES.split(',').map((s)=> s.trim())
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use variable names that describe the variable.

Maybe didUri and property?

Comment on lines 5 to 7
// Here you can set which type of credential (cType) your dApp will request users to login.
// You can change it by importing a different one.
// Establish which cTypes our dApp accepts and which attesters we trust:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would replace this by adding an explainer (docs) to the variable cTypeToRequest.

Maybe something like this:

/** Establish which type of credential (cType) our dApp will request users to login,
 * which properties are necessary and which attesters we trust.
 *
 * This is defined by the constants imported from the config.
 * Modify the `env`-file to adapt it to your liking.
 */
export const cTypeToRequest: Kilt.IRequestCredentialContent = {

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add this and rename the variable to be in plural.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

Copy link
Contributor

Choose a reason for hiding this comment

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

This file does not include the cTypeRequest. The request is prepare on buildCredentialRequest.

Please, rename this file to cTypeToRequest.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please do this? 🙏

Copy link
Contributor

Choose a reason for hiding this comment

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

Now in plural cTypesToRequest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

.env.example Show resolved Hide resolved
backend/src/access/login.ts Outdated Show resolved Hide resolved
Comment on lines 43 to 45
// Check if any properties have been provided. If not, log in as 'Anonymous User'.
// If any property exists, send the object's first value as 'authenticationToken'
// to ensure login with any 'ctype'.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally, authenticationToken does not have the plain user info, but rather something only the server can identify. How authentification tokens are made changes from website to website. Because we did not want to prescribe people how to do it, we took the simplest approach (some plain user info) and encourage people customize it afterwards.

Suggested change
// Check if any properties have been provided. If not, log in as 'Anonymous User'.
// If any property exists, send the object's first value as 'authenticationToken'
// to ensure login with any 'ctype'.
// Check if any properties have been provided. If not, send 'Anonymous User' to display on the frontend.
// If any property exists, send object's first attribute value,
// ensuring compatibility with any 'cType'.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

backend/src/config.ts Outdated Show resolved Hide resolved
README.md Outdated
@@ -129,6 +129,23 @@ The following variables are required:
- `DAPP_DID_URI` = _This is the URI of the Kilt DID that identifies your dApp_
- `DAPP_NAME` = _This should be a custom name for your dApp_
- `JWT_SIGNER_SECRET` = _This is secret key (string) that signs the Json-Web-Tokens before saving them in the Cookies_
- `CTYPE_HASH` = _This is type of credential (CType) your dApp will request from users for login_
- `TRUSTED_ATTESTERS` = _This is the DID that identifies the attestors whose attestations are accepted_
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `TRUSTED_ATTESTERS` = _This is the DID that identifies the attestors whose attestations are accepted_
- `TRUSTED_ATTESTERS` = _This is a list of attesters DIDs (c.s.v.`,`). Only credentials issued by them will be considered valid_

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

README.md Outdated
@@ -129,6 +129,23 @@ The following variables are required:
- `DAPP_DID_URI` = _This is the URI of the Kilt DID that identifies your dApp_
- `DAPP_NAME` = _This should be a custom name for your dApp_
- `JWT_SIGNER_SECRET` = _This is secret key (string) that signs the Json-Web-Tokens before saving them in the Cookies_
- `CTYPE_HASH` = _This is type of credential (CType) your dApp will request from users for login_
- `TRUSTED_ATTESTERS` = _This is the DID that identifies the attestors whose attestations are accepted_
- `REQUIRED_PROPERTIES` = _These are the required properties that identify the CType_
Copy link
Contributor

@rompemoldes rompemoldes Feb 15, 2024

Choose a reason for hiding this comment

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

Suggested change
- `REQUIRED_PROPERTIES` = _These are the required properties that identify the CType_
- `REQUIRED_PROPERTIES` = _This is a subset of CType properties (c.s.v.`,`) required to be exposed on credential presentation_

This properties do not define the CType. They are just the properties out of the CType that we are asking for.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

Copy link
Contributor

@rompemoldes rompemoldes left a comment

Choose a reason for hiding this comment

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

One last but big thing is:
Please, update genesisEnvironmentVariables.ts to ask developers to set up the 3 new environment variables. You can then suggest our "defaults" on the prompts.

README.md Outdated Show resolved Hide resolved
README.md Outdated

To proceed, you may select the desired credential through the CType Environment Variables listed below, allowing you to tailor the authentication process to your needs.

| Socail KYC | CTYPE_HASH | TRUSTED_ATTESTERS(spiritnet) | TRUSTED_ATTESTERS(peregrine) | REQUIRED_PROPERTIES |
Copy link
Contributor

Choose a reason for hiding this comment

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

The whole table just has some useful information about some recommended cTypes. I would give it an according description and also a title (via ###on markdown). Maybe "Info about example/recommended cTypes" or something like that.

Please, also signalise somehow that we only recommend SocialKYC and the types of credentials it issues.
This is also a good place to explain why the cType-hash is the same for both chains.

The first row is not great. The first column should be "Title", not "SocialKYC".

Both TRUSTED_ATTESTERS(spiritnet) and TRUSTED_ATTESTERS(peregrine) should rather be SocialKYC on Spiritnet or on SocialKYC on Peregrine.

Maybe you can first list the two SocialKYC DIDs and then add references to them on the table. Then you can leave the title Trusted Attesters. That would be more fitting, if later we decide to add an external attester to this list.

You will have to make them subtitles to be able to reference them, like this:

####SocialKYC on the Production: did:kilt:...

And then inside the table (prod. SYKC)[#SocialKYC on the Production]

And on the properties column is maybe better to include all properties and let them decide. This would make the "required" part false. But the columns name really don't need to be the name of the CONSTANTS.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

README.md Show resolved Hide resolved
Copy link
Contributor Author

@aybarsayan aybarsayan left a comment

Choose a reason for hiding this comment

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

Thanks for the review

.env.example Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated
@@ -129,6 +129,23 @@ The following variables are required:
- `DAPP_DID_URI` = _This is the URI of the Kilt DID that identifies your dApp_
- `DAPP_NAME` = _This should be a custom name for your dApp_
- `JWT_SIGNER_SECRET` = _This is secret key (string) that signs the Json-Web-Tokens before saving them in the Cookies_
- `CTYPE_HASH` = _This is type of credential (CType) your dApp will request from users for login_
- `TRUSTED_ATTESTERS` = _This is the DID that identifies the attestors whose attestations are accepted_
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

README.md Outdated
@@ -129,6 +129,23 @@ The following variables are required:
- `DAPP_DID_URI` = _This is the URI of the Kilt DID that identifies your dApp_
- `DAPP_NAME` = _This should be a custom name for your dApp_
- `JWT_SIGNER_SECRET` = _This is secret key (string) that signs the Json-Web-Tokens before saving them in the Cookies_
- `CTYPE_HASH` = _This is type of credential (CType) your dApp will request from users for login_
- `TRUSTED_ATTESTERS` = _This is the DID that identifies the attestors whose attestations are accepted_
- `REQUIRED_PROPERTIES` = _These are the required properties that identify the CType_
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

README.md Outdated

To proceed, you may select the desired credential through the CType Environment Variables listed below, allowing you to tailor the authentication process to your needs.

| Socail KYC | CTYPE_HASH | TRUSTED_ATTESTERS(spiritnet) | TRUSTED_ATTESTERS(peregrine) | REQUIRED_PROPERTIES |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

README.md Outdated Show resolved Hide resolved
Comment on lines 43 to 45
// Check if any properties have been provided. If not, log in as 'Anonymous User'.
// If any property exists, send the object's first value as 'authenticationToken'
// to ensure login with any 'ctype'.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4fe1b4e

@aybarsayan
Copy link
Contributor Author

One last but big thing is: Please, update genesisEnvironmentVariables.ts to ask developers to set up the 3 new environment variables. You can then suggest our "defaults" on the prompts.

This is resolved at: 8c89cc8

@aybarsayan aybarsayan requested a review from rompemoldes March 7, 2024 11:08
Copy link
Contributor

@rompemoldes rompemoldes left a comment

Choose a reason for hiding this comment

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

Very Good!

I haven't tried the multiple cTypes yet, thats why I haven't approve yet.

README.md Outdated
Comment on lines 125 to 127
- `CTYPE_HASH` = _This is the type of credential (CType) your dApp will request from users for login. If you want to specify more than one CType, you can do so by adding a '/' sign between them_
- `TRUSTED_ATTESTERS` = _This is a list of attester DIDs (CSV, separated by ','). Only credentials issued by these attesters will be considered valid. If you are using more than one CType, you can specify the trusted attesters by adding a '/' sign between them_
- `REQUIRED_PROPERTIES` = _This is a subset of CType properties (CSV, separated by ',') required to be exposed on credential presentation. If you are using more than one CType, you can specify the required properties by adding a '/' sign between them._
Copy link
Contributor

Choose a reason for hiding this comment

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

Very nice!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank yo 😊 really appreciated

Comment on lines 5 to 7
// Here you can set which type of credential (cType) your dApp will request users to login.
// You can change it by importing a different one.
// Establish which cTypes our dApp accepts and which attesters we trust:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add this and rename the variable to be in plural.

Copy link
Contributor

Choose a reason for hiding this comment

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

Now in plural cTypesToRequest

Comment on lines 264 to 271
function imploreCtypeHash() {
console.log(
'Please provide a name for your CTYPE_HASH inside the .env file using this constant name: \n',
`CTYPE_HASH={your CType Hash}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`CTYPE_HASH=0x3291bb126e33b4862d421bfaa1d2f272e6cdfc4f96658988fbcffea8914bd9ac\n`
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function imploreCtypeHash() {
console.log(
'Please provide a name for your CTYPE_HASH inside the .env file using this constant name: \n',
`CTYPE_HASH={your CType Hash}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`CTYPE_HASH=0x3291bb126e33b4862d421bfaa1d2f272e6cdfc4f96658988fbcffea8914bd9ac\n`
)
}
function imploreCtypeHash() {
console.log(
'Please provide the CType Hash(es) inside the .env file using this constant name:.\n',
'Your dApp will only accept credentials of this given Claim Type(s).',
`CTYPE_HASH={CType IDs your dApp consider valid}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`CTYPE_HASH=0x3291bb126e33b4862d421bfaa1d2f272e6cdfc4f96658988fbcffea8914bd9ac\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.

Done at: 4868513

Comment on lines +272 to +279
function imploreTrustedAttesters() {
console.log(
'Please provide a list for your Trusted Attesters inside the .env file using this constant name: \n',
`TRUSTED_ATTESTERS={lists of trusted attesters}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`TRUSTED_ATTESTERS=did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY\n`
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function imploreTrustedAttesters() {
console.log(
'Please provide a list for your Trusted Attesters inside the .env file using this constant name: \n',
`TRUSTED_ATTESTERS={lists of trusted attesters}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`TRUSTED_ATTESTERS=did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY\n`
)
}
function imploreTrustedAttesters() {
console.log(
'Please provide a list for your Trusted Attesters inside the .env file using this constant name: \n',
'Your dApp will only accept credentials issued by one of this attesters.',
`TRUSTED_ATTESTERS={lists of trusted attesters}\n`,
`If you wish to use the default and accept Credentials issued by SocialKYC.io on Peregrine, please add the following line to your .env file:\n`,
`TRUSTED_ATTESTERS=did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY\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.

Done at: 4868513

Comment on lines 280 to 287
function imploreRequestedProperties() {
console.log(
'Please provide a list for your Requested Properties inside the .env file using this constant name: \n',
`REQUIRED_PROPERTIES={lists of Requested Properties}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`REQUIRED_PROPERTIES=Email\n`
)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
function imploreRequestedProperties() {
console.log(
'Please provide a list for your Requested Properties inside the .env file using this constant name: \n',
`REQUIRED_PROPERTIES={lists of Requested Properties}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`REQUIRED_PROPERTIES=Email\n`
)
}
function imploreRequestedProperties() {
console.log(
'Please provide a list of Required Properties inside the .env file using this constant name: \n',
`REQUIRED_PROPERTIES={lists of Properties users should be Required to disclose}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`REQUIRED_PROPERTIES=Email\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.

Done at: 4868513

README.md Outdated
Comment on lines 133 to 135
#### SocialKYC on Spiritnet: did:kilt:4pnfkRn5UurBJTW92d9TaVLR2CqJdY4z5HPjrEbpGyBykare

#### SocialKYC on Peregrine: did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY
Copy link
Contributor

Choose a reason for hiding this comment

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

The title and the content need to be on different lines. Right now the links on the table do not work.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can also add the links from the websites here, e.g. https://test.socialkyc.io and https://socialkyc.io

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

Copy link
Contributor

@rompemoldes rompemoldes left a comment

Choose a reason for hiding this comment

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

Nice work, man.

I now tested the support for multiple cTypes. Awesome!

Please, follow what I suggested on the last comments (and the ones long forgotten) before doing the merge.

You have waited enough. Approved. 🚀

README.md Outdated
@@ -129,6 +122,33 @@ The following variables are required:
- `DAPP_DID_URI` = _This is the URI of the Kilt DID that identifies your dApp_
- `DAPP_NAME` = _This should be a custom name for your dApp_
- `JWT_SIGNER_SECRET` = _This is secret key (string) that signs the Json-Web-Tokens before saving them in the Cookies_
- `CTYPE_HASH` = _This is the type of credential (CType) your dApp will request from users for login. If you want to specify more than one CType, you can do so by adding a '/' sign between them_
- `TRUSTED_ATTESTERS` = _This is a list of attester DIDs (CSV, separated by ','). Only credentials issued by these attesters will be considered valid. If you are using more than one CType, you can specify the trusted attesters by adding a '/' sign between them_
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- `TRUSTED_ATTESTERS` = _This is a list of attester DIDs (CSV, separated by ','). Only credentials issued by these attesters will be considered valid. If you are using more than one CType, you can specify the trusted attesters by adding a '/' sign between them_
- `TRUSTED_ATTESTERS` = _This is a list of attester DIDs (CSV, separated by ','). Only credentials issued by these attesters will be considered valid. If you are using more than one CType, indicate the groups of trusted attesters by respectively separating them with a '/' sign._

Do it similarly for the REQUIRED_PROPERTIES

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

Copy link
Contributor Author

@aybarsayan aybarsayan left a comment

Choose a reason for hiding this comment

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

Thank you so much for your reviews 😊

README.md Outdated
@@ -129,6 +122,33 @@ The following variables are required:
- `DAPP_DID_URI` = _This is the URI of the Kilt DID that identifies your dApp_
- `DAPP_NAME` = _This should be a custom name for your dApp_
- `JWT_SIGNER_SECRET` = _This is secret key (string) that signs the Json-Web-Tokens before saving them in the Cookies_
- `CTYPE_HASH` = _This is the type of credential (CType) your dApp will request from users for login. If you want to specify more than one CType, you can do so by adding a '/' sign between them_
- `TRUSTED_ATTESTERS` = _This is a list of attester DIDs (CSV, separated by ','). Only credentials issued by these attesters will be considered valid. If you are using more than one CType, you can specify the trusted attesters by adding a '/' sign between them_
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

README.md Outdated
Comment on lines 133 to 135
#### SocialKYC on Spiritnet: did:kilt:4pnfkRn5UurBJTW92d9TaVLR2CqJdY4z5HPjrEbpGyBykare

#### SocialKYC on Peregrine: did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

Comment on lines 5 to 7
// Here you can set which type of credential (cType) your dApp will request users to login.
// You can change it by importing a different one.
// Establish which cTypes our dApp accepts and which attesters we trust:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done at: 4868513

Comment on lines 264 to 271
function imploreCtypeHash() {
console.log(
'Please provide a name for your CTYPE_HASH inside the .env file using this constant name: \n',
`CTYPE_HASH={your CType Hash}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`CTYPE_HASH=0x3291bb126e33b4862d421bfaa1d2f272e6cdfc4f96658988fbcffea8914bd9ac\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.

Done at: 4868513

Comment on lines +272 to +279
function imploreTrustedAttesters() {
console.log(
'Please provide a list for your Trusted Attesters inside the .env file using this constant name: \n',
`TRUSTED_ATTESTERS={lists of trusted attesters}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`TRUSTED_ATTESTERS=did:kilt:4pehddkhEanexVTTzWAtrrfo2R7xPnePpuiJLC7shQU894aY\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.

Done at: 4868513

Comment on lines 280 to 287
function imploreRequestedProperties() {
console.log(
'Please provide a list for your Requested Properties inside the .env file using this constant name: \n',
`REQUIRED_PROPERTIES={lists of Requested Properties}\n`,
`If you wish to use the default Email Credential settings, please add the following line to your .env file:\n`,
`REQUIRED_PROPERTIES=Email\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.

Done at: 4868513

@aybarsayan aybarsayan reopened this Mar 13, 2024
@aybarsayan aybarsayan merged commit 0882d58 into KILTprotocol:main Mar 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants