Skip to content

Commit

Permalink
add webhooks documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcbaque committed Feb 29, 2024
1 parent 5402a21 commit 4a9bb65
Show file tree
Hide file tree
Showing 69 changed files with 953 additions and 342 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/docsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,24 @@ name: Run algolia docsearch
on:
push:
branches:
- master
- master
schedule:
- cron: '0 12 * * 1'
- cron: '0 12 * * 1'
jobs:
docsearch:
runs-on: ubuntu-latest
if: github.repository == 'bloock/bloock-docs'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- name: Setup environment
run: |
echo "APPLICATION_ID=$APPLICATION_ID" >> .env
echo "API_KEY=$API_KEY" >> .env
chmod +x ./bin/crawl.sh
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_DOCSEARCH_APP_ID }}
API_KEY: ${{ secrets.ALGOLIA_DOCSEARCH_API_KEY }}

- name: Setup environment
run: |
echo "APPLICATION_ID=$APPLICATION_ID" >> .env
echo "API_KEY=$API_KEY" >> .env
chmod +x ./bin/crawl.sh
env:
APPLICATION_ID: ${{ secrets.ALGOLIA_DOCSEARCH_APP_ID }}
API_KEY: ${{ secrets.ALGOLIA_DOCSEARCH_API_KEY }}

- name: Run docsearch
continue-on-error: true
run: |
./bin/crawl.sh
- name: Run docsearch
continue-on-error: true
run: |
./bin/crawl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import SignPhp from '!!raw-loader!@site/examples/key/sign/sign.php';
import SignGo from '!!raw-loader!@site/examples/key/sign/sign.go';

<SdkCodeBlock
js={SignJs}
ts={SignJs}
py={SignPy}
java={SignJava}
php={SignPhp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import VerifyPhp from '!!raw-loader!@site/examples/key/verify/verify.php';
import VerifyGo from '!!raw-loader!@site/examples/key/verify/verify.go';

<SdkCodeBlock
js={VerifyJs}
ts={VerifyJs}
py={VerifyPy}
java={VerifyJava}
php={VerifyPhp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import DecryptAesPhp from '!!raw-loader!@site/examples/key/decrypt_aes/decrypt_a
import DecryptAesGo from '!!raw-loader!@site/examples/key/decrypt_aes/decrypt_aes.go';

<SdkCodeBlock
js={DecryptAesJs}
ts={DecryptAesJs}
py={DecryptAesPy}
java={DecryptAesJava}
php={DecryptAesPhp}
Expand All @@ -30,7 +30,7 @@ import DecryptRsaPhp from '!!raw-loader!@site/examples/key/decrypt_rsa/decrypt_r
import DecryptRsaGo from '!!raw-loader!@site/examples/key/decrypt_rsa/decrypt_rsa.go';

<SdkCodeBlock
js={DecryptRsaJs}
ts={DecryptRsaJs}
py={DecryptRsaPy}
java={DecryptRsaJava}
php={DecryptRsaPhp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import EncryptAesPhp from '!!raw-loader!@site/examples/key/encrypt_aes/encrypt_a
import EncryptAesGo from '!!raw-loader!@site/examples/key/encrypt_aes/encrypt_aes.go';

<SdkCodeBlock
js={EncryptAesJs}
ts={EncryptAesJs}
py={EncryptAesPy}
java={EncryptAesJava}
php={EncryptAesPhp}
Expand All @@ -30,7 +30,7 @@ import EncryptRsaPhp from '!!raw-loader!@site/examples/key/encrypt_rsa/encrypt_r
import EncryptRsaGo from '!!raw-loader!@site/examples/key/encrypt_rsa/encrypt_rsa.go';

<SdkCodeBlock
js={EncryptRsaJs}
ts={EncryptRsaJs}
py={EncryptRsaPy}
java={EncryptRsaJava}
php={EncryptRsaPhp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import NewLocalKeyPhp from '!!raw-loader!@site/examples/key/new_local_key/new_lo
import NewLocalKeyGo from '!!raw-loader!@site/examples/key/new_local_key/new_local_key.go';

<SdkCodeBlock
js={NewLocalKeyJs}
ts={NewLocalKeyJs}
py={NewLocalKeyPy}
java={NewLocalKeyJava}
php={NewLocalKeyPhp}
Expand All @@ -41,7 +41,7 @@ import LoadLocalKeyPhp from '!!raw-loader!@site/examples/key/load_local_key/load
import LoadLocalKeyGo from '!!raw-loader!@site/examples/key/load_local_key/load_local_key.go';

<SdkCodeBlock
js={LoadLocalKeyJs}
ts={LoadLocalKeyJs}
py={LoadLocalKeyPy}
java={LoadLocalKeyJava}
php={LoadLocalKeyPhp}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import NewManagedKeyPhp from '!!raw-loader!@site/examples/key/new_managed_key/ne
import NewManagedKeyGo from '!!raw-loader!@site/examples/key/new_managed_key/new_managed_key.go';

<SdkCodeBlock
js={NewManagedKeyJs}
ts={NewManagedKeyJs}
py={NewManagedKeyPy}
java={NewManagedKeyJava}
php={NewManagedKeyPhp}
Expand All @@ -39,7 +39,7 @@ import LoadManagedKeyPhp from '!!raw-loader!@site/examples/key/load_managed_key/
import LoadManagedKeyGo from '!!raw-loader!@site/examples/key/load_managed_key/load_managed_key.go';

<SdkCodeBlock
js={LoadManagedKeyJs}
ts={LoadManagedKeyJs}
py={LoadManagedKeyPy}
java={LoadManagedKeyJava}
php={LoadManagedKeyPhp}
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/products/availability/features/publish.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import PublishHostedPhp from '!!raw-loader!@site/examples/availability/publish_h
import PublishHostedGo from '!!raw-loader!@site/examples/availability/publish_hosted/publish_hosted.go';

<SdkCodeBlock
js={PublishHostedJs}
ts={PublishHostedJs}
py={PublishHostedPy}
java={PublishHostedJava}
php={PublishHostedPhp}
Expand All @@ -32,7 +32,7 @@ import PublishIpfsPhp from '!!raw-loader!@site/examples/availability/publish_ipf
import PublishIpfsGo from '!!raw-loader!@site/examples/availability/publish_ipfs/publish_ipfs.go';

<SdkCodeBlock
js={PublishIpfsJs}
ts={PublishIpfsJs}
py={PublishIpfsPy}
java={PublishIpfsJava}
php={PublishIpfsPhp}
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/products/availability/features/retrieve.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import RetrieveHostedPhp from '!!raw-loader!@site/examples/availability/retrieve
import RetrieveHostedGo from '!!raw-loader!@site/examples/availability/retrieve_hosted/retrieve_hosted.go';

<SdkCodeBlock
js={RetrieveHostedJs}
ts={RetrieveHostedJs}
py={RetrieveHostedPy}
java={RetrieveHostedJava}
php={RetrieveHostedPhp}
Expand All @@ -32,7 +32,7 @@ import RetrieveIpfsPhp from '!!raw-loader!@site/examples/availability/retrieve_i
import RetrieveIpfsGo from '!!raw-loader!@site/examples/availability/retrieve_ipfs/retrieve_ipfs.go';

<SdkCodeBlock
js={RetrieveIpfsJs}
ts={RetrieveIpfsJs}
py={RetrieveIpfsPy}
java={RetrieveIpfsJava}
php={RetrieveIpfsPhp}
Expand Down
7 changes: 4 additions & 3 deletions docs/guides/products/identity/features/create-credential.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sidebar_position: 3
---

To create a credential, we will need four very important things.

1. I need the schema identifier that it will reference, which will therefore mark which attribute structure it will have. In my case it will be my employee number, name and date of birth.
2. I will need the BJJ key created for that Issuer, because when we create a credential let's remember that in order to be verifiable we need to be able to sign it and get a proof of authenticity.
3. You should know who is going to be the Holder of this credential or rather which is the user who is going to receive this credential. This Holder must have created his own identity at the same time. For example, in the case of our employee for whom we are going to issue this credential, the following DID identifies him/her: `did:polygonid:polygon:main:2q544HUegzeRpwr3V2qu9eMwgrAmF5x4E1NCPzbQc4`.
Expand All @@ -15,7 +16,7 @@ Once the credential is created we will obtain a UUID identifier.
The most important thing is that this credential is already a [Verifiable Credential (VC)](#the-verifiable-credential) because it already includes a signature proof, and therefore, this credential would already be valid to be verified.

But BLOOCK Identity's product offers a second proof, related to integrity in blockchain.
The [Sparse Merkle Tree proof](#proofs) is a proof that will be available depending on the [interval time](#issuer-intervals) you have chosen and is related to the Issuer's state.
The [Sparse Merkle Tree proof](#proofs) is a proof that will be available depending on the [interval time](#issuer-intervals) you have chosen and is related to the Issuer's state.
As I have previously chosen a 60 minutes interval, it means that I will have my SMTP proof available after ~60 minutes.

## Examples
Expand All @@ -29,9 +30,9 @@ import CreateCredentialPhp from '!!raw-loader!@site/examples/identity/create_cre
import CreateCredentialGo from '!!raw-loader!@site/examples/identity/create_credential/create_credential.go';

<SdkCodeBlock
js={CreateCredentialJs}
ts={CreateCredentialJs}
py={CreateCredentialPy}
java={CreateCredentialJava}
php={CreateCredentialPhp}
go={CreateCredentialGo}
/>
/>
4 changes: 2 additions & 2 deletions docs/guides/products/identity/features/create-holder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import CreateHolderPhp from '!!raw-loader!@site/examples/identity/create_holder/
import CreateHolderGo from '!!raw-loader!@site/examples/identity/create_holder/create_holder.go';

<SdkCodeBlock
js={CreateHolderJs}
ts={CreateHolderJs}
py={CreateHolderPy}
java={CreateHolderJava}
php={CreateHolderPhp}
go={CreateHolderGo}
/>
/>
7 changes: 4 additions & 3 deletions docs/guides/products/identity/features/create-issuer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ sidebar_position: 1
In order to create an identity in BLOOCK Identity I will first need to create or have a Baby JubJub (BJJ) key. This key will be very important to have it saved because it will be used to control our Issuer.

You have two options to get this key.

1. You can create a BJJ key with our managed key product ([BLOOCK Keys product](go_to_keys_documentation)), your key will be identified by a UUID. This identifier will be enough to control your Issuer.
`Example: 6f36448d-49f3-4b0e-aa72-6e55863302e8`
`Example: 6f36448d-49f3-4b0e-aa72-6e55863302e8`
2. If you have created a BJJ type key locally, i.e. you are aware of its private key, then you can use it to control your Issuer.
`Example: bf5e13dd8d9f784aee781b4de7836caa3499168514553eaa3d892911ad3c345j`
`Example: bf5e13dd8d9f784aee781b4de7836caa3499168514553eaa3d892911ad3c345j`

## Examples

Expand All @@ -22,7 +23,7 @@ import CreateIssuerPhp from '!!raw-loader!@site/examples/identity/create_issuer/
import CreateIssuerGo from '!!raw-loader!@site/examples/identity/create_issuer/create_issuer.go';

<SdkCodeBlock
js={CreateIssuerJs}
ts={CreateIssuerJs}
py={CreateIssuerPy}
java={CreateIssuerJava}
php={CreateIssuerPhp}
Expand Down
5 changes: 3 additions & 2 deletions docs/guides/products/identity/features/create-schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ sidebar_position: 2
---

Next, we must think about what type of credentials we want to issue. For example, we want to issue a card that identifies BLOOCK employees. In order to create the schema I have to follow these steps.

1. I must first think about the name of the schema type, in this case for example it would be BloockEmployee.
2. I must define what attributes my credential will have, for example, I will put an employee number, name and date of birth.

Expand All @@ -23,9 +24,9 @@ import CreateSchemaPhp from '!!raw-loader!@site/examples/identity/create_schema/
import CreateSchemaGo from '!!raw-loader!@site/examples/identity/create_schema/create_schema.go';

<SdkCodeBlock
js={CreateSchemaJs}
ts={CreateSchemaJs}
py={CreateSchemaPy}
java={CreateSchemaJava}
php={CreateSchemaPhp}
go={CreateSchemaGo}
/>
/>
10 changes: 5 additions & 5 deletions docs/guides/products/identity/features/credential-offering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: 'Credential Offering'
sidebar_position: 4
---

The credential offering process refers to the transfer of the Verifiable Credential (VC) to the assigned user or Holder.
It requires two agents (Issuer and Holder) and a [wallet or software](#what-is-a-wallet) where the credential will be stored.
At the Holder level, this is done by scanning a QR code generated by the Issuer from the Holder's wallet.
The credential offering process refers to the transfer of the Verifiable Credential (VC) to the assigned user or Holder.
It requires two agents (Issuer and Holder) and a [wallet or software](#what-is-a-wallet) where the credential will be stored.
At the Holder level, this is done by scanning a QR code generated by the Issuer from the Holder's wallet.
At the protocol level this communication is highly secure thanks to the [DIDComm protocol](#dIDComm-messaging) used and the authentication and identity proofs mechanisms.

## Examples
Expand All @@ -19,9 +19,9 @@ import CredentialOfferingPhp from '!!raw-loader!@site/examples/identity/credenti
import CredentialOfferingGo from '!!raw-loader!@site/examples/identity/credential_offering/credential_offering.go';

<SdkCodeBlock
js={CredentialOfferingJs}
ts={CredentialOfferingJs}
py={CredentialOfferingPy}
java={CredentialOfferingJava}
php={CredentialOfferingPhp}
go={CredentialOfferingGo}
/>
/>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Credential Revocation'
sidebar_position: 5
---

Finally, Issuer may decide to revoke or invalidate any credential. Therefore, you will have to execute the [revocation](#revocation) process.
Finally, Issuer may decide to revoke or invalidate any credential. Therefore, you will have to execute the [revocation](#revocation) process.
Having a credential revoked what it means is that the Holder will not be able to generate any [proof](#proofs).
When you revoke a credential what we are doing is generate a new [Sparse Merkle Tree Proof](#proof) of revoation. Therefore, we need the [Issuer's state](#state-transition) to be processed once the revocation action is executed. And obviously this state transition will be marked by the [interval](#issuer-intervals) we have set. **It is important to note that the effect of the revocation will not be visible until this Issuer state transition is executed**.

Expand All @@ -18,9 +18,9 @@ import CredentialRevocationPhp from '!!raw-loader!@site/examples/identity/creden
import CredentialRevocationGo from '!!raw-loader!@site/examples/identity/credential_revocation/credential_revocation.go';

<SdkCodeBlock
js={CredentialRevocationJs}
ts={CredentialRevocationJs}
py={CredentialRevocationPy}
java={CredentialRevocationJava}
php={CredentialRevocationPhp}
go={CredentialRevocationGo}
/>
/>
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import E2EManagedKeyPhp from '!!raw-loader!@site/examples/identity/e2e_examples/
import E2EManagedKeyGo from '!!raw-loader!@site/examples/identity/e2e_examples/e2e_managed_key/e2e_managed_key.go';

<SdkCodeBlock
js={E2EManagedKeyJs}
ts={E2EManagedKeyJs}
py={E2EManagedKeyPy}
java={E2EManagedKeyJava}
php={E2EManagedKeyPhp}
go={E2EManagedKeyGo}
/>
/>
12 changes: 3 additions & 9 deletions docs/guides/products/identity/features/other-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ import GetCredentialPhp from '!!raw-loader!@site/examples/identity/get_credentia
import GetCredentialGo from '!!raw-loader!@site/examples/identity/get_credential/get_credential.go';

<SdkCodeBlock
js={GetCredentialJs}
ts={GetCredentialJs}
py={GetCredentialPy}
java={GetCredentialJava}
php={GetCredentialPhp}
go={GetCredentialGo}
/>


## Get Schema

import GetSchemaJs from '!!raw-loader!@site/examples/identity/get_schema/get_schema.ts';
Expand All @@ -31,14 +30,13 @@ import GetSchemaPhp from '!!raw-loader!@site/examples/identity/get_schema/get_sc
import GetSchemaGo from '!!raw-loader!@site/examples/identity/get_schema/get_schema.go';

<SdkCodeBlock
js={GetSchemaJs}
ts={GetSchemaJs}
py={GetSchemaPy}
java={GetSchemaJava}
php={GetSchemaPhp}
go={GetSchemaGo}
/>


## Credential to JSON / JSON to Credential

import CredentialJSONJs from '!!raw-loader!@site/examples/identity/credential_json/credential_json.ts';
Expand All @@ -48,13 +46,9 @@ import CredentialJSONPhp from '!!raw-loader!@site/examples/identity/credential_j
import CredentialJSONGo from '!!raw-loader!@site/examples/identity/credential_json/credential_json.go';

<SdkCodeBlock
js={CredentialJSONJs}
ts={CredentialJSONJs}
py={CredentialJSONPy}
java={CredentialJSONJava}
php={CredentialJSONPhp}
go={CredentialJSONGo}
/>




14 changes: 8 additions & 6 deletions docs/guides/products/identity/features/verification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ sidebar_position: 6
BLOOCK's identity product allows you to act as [verification agents](#the-verifier) as well. Once our users or holders have their credentials, they will want to be able to verify themselves.

At this point, you have two options:

1. Using external verifiers.
2. Create your own verifier through BLOOCK.
2. Create your own verifier through BLOOCK.

If you want to use our verification process, here is how it works:

1. You must create a request, which is nothing more than a QR code to show to the user or Holder you want to verify. In order to create the request you need to create a [Validation Query](#validation-queries). This functionality is available in our dashboard.
2. Then, you will have to wait for your Holder to scan the request with its wallet or software and generate the proof on your request.
>It is important to note that within the request that you will show to your Holder, you can specify what things you want to validate. For example, you can determine that you only want to verify that it holds a credential of the type BloockEmployee or you can verify something more specific, such as that your employee's date of birth is less than 2000.
3. Once you receive the proof from the Holder, it will be verified, and you will get a result of true or false, verified or not verified. The BLOOCK verification process establishes a customizable logic, adding an expiration time to the requests, by default 60 min. This means that when the request is created it will be invalidated after 60 min. If the user was already verified, after 60 minutes it will have to be verified again.
2. Then, you will have to wait for your Holder to scan the request with its wallet or software and generate the proof on your request.
> It is important to note that within the request that you will show to your Holder, you can specify what things you want to validate. For example, you can determine that you only want to verify that it holds a credential of the type BloockEmployee or you can verify something more specific, such as that your employee's date of birth is less than 2000.
3. Once you receive the proof from the Holder, it will be verified, and you will get a result of true or false, verified or not verified. The BLOOCK verification process establishes a customizable logic, adding an expiration time to the requests, by default 60 min. This means that when the request is created it will be invalidated after 60 min. If the user was already verified, after 60 minutes it will have to be verified again.

## Examples

Expand All @@ -26,9 +28,9 @@ import VerificationPhp from '!!raw-loader!@site/examples/identity/verification/v
import VerificationGo from '!!raw-loader!@site/examples/identity/verification/verification.go';

<SdkCodeBlock
js={VerificationJs}
ts={VerificationJs}
py={VerificationPy}
java={VerificationJava}
php={VerificationPhp}
go={VerificationGo}
/>
/>
Loading

0 comments on commit 4a9bb65

Please sign in to comment.