Class IdentityRecordsBankApi
- java.lang.Object
-
- app.cybrid.cybrid_api_bank.client.api.IdentityRecordsBankApi
-
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2022-06-21T13:21:46.858713Z[Etc/UTC]") public class IdentityRecordsBankApi extends Object
-
-
Constructor Summary
Constructors Constructor Description IdentityRecordsBankApi()IdentityRecordsBankApi(ApiClient apiClient)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description reactor.core.publisher.Mono<IdentityRecordBankModel>createIdentityRecord(PostIdentityRecordBankModel postIdentityRecordBankModel)Create Identity Record Creates an identity record.reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<IdentityRecordBankModel>>createIdentityRecordWithHttpInfo(PostIdentityRecordBankModel postIdentityRecordBankModel)ApiClientgetApiClient()reactor.core.publisher.Mono<IdentityRecordBankModel>getIdentityRecord(String identityRecordGuid)Get Identity Record Retrieves an identity record.reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<IdentityRecordBankModel>>getIdentityRecordWithHttpInfo(String identityRecordGuid)reactor.core.publisher.Mono<IdentityRecordListBankModel>listIdentityRecords(String customerGuid, BigInteger page, BigInteger perPage)List Identity Records Retrieves a listing of identity records for a bank.reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<IdentityRecordListBankModel>>listIdentityRecordsWithHttpInfo(String customerGuid, BigInteger page, BigInteger perPage)voidsetApiClient(ApiClient apiClient)
-
-
-
Constructor Detail
-
IdentityRecordsBankApi
public IdentityRecordsBankApi()
-
IdentityRecordsBankApi
@Autowired public IdentityRecordsBankApi(ApiClient apiClient)
-
-
Method Detail
-
getApiClient
public ApiClient getApiClient()
-
setApiClient
public void setApiClient(ApiClient apiClient)
-
createIdentityRecord
public reactor.core.publisher.Mono<IdentityRecordBankModel> createIdentityRecord(PostIdentityRecordBankModel postIdentityRecordBankModel) throws org.springframework.web.reactive.function.client.WebClientResponseException
Create Identity Record Creates an identity record. ## Identity Records Identity Records verify an individual for inclusion on the platform. This know-your-customer (KYC) process is a requirement for individuals to be able to transact. At present, we offer support for Attestation Identity Records. Once an Identity Record has been submitted, it will be reviewed by our system and transit through a lifecycle before ultimately being `verified` or `failed`. If an Identity Record is ends up `failed`, contextual information as to the reason may be provided on the resource and additional attempts can be made. ## Attestation Identity Records An Attestation Identity Record is a confirmation of fact that the Organization has completed their own KYC process and can vouch for its correctness. Prior to uploading `verified` attestation identity records, an Organization must register their signing public key with their Bank through the create Verification Key API. To create an attestation identity record, a signed JWT is required as proof that the Customer's identity has been verified by the Organization. When creating the JWT, the Organization must use the RS512 signing algorithm. The JWT must contain the following headers: - **alg**: The RS512 algorithm value, e.g., 'RS512'. - **kid**: Set to the guid of the verification key that has been registered for the Bank The JWT must contain the following claims: - **iss**: Set to http://api.cybrid.app/banks/{bank_guid} - **aud**: Set to http://api.cybrid.app - **sub**: Set to http://api.cybrid.app/customers/{customer_guid} - **iat**: Set to the time at which the JWT was issued - **exp**: Set to the time after which the JWT expires - **jti**: Set to a unique identifier for the JWT Example code (python) for generating an Attestation Identity Record JWT token: ```python # Assumes an RSA private key has been generated (`private_key`), a Verification Key has been created and a `verification_key_guid` is available. # # `customer_guid` should be set to the guid assigned to a Customer that has been created. # `bank_guid` should be set to the guid of your bank # import uuid from datetime import datetime, timezone, timedelta from jwcrypto import jwt, jwk from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.serialization import load_pem_private_key algorithm = 'RS512' issued_at = datetime.now(timezone.utc) expired_at = issued_at + timedelta(days=365) with open(\"verification_key.pem\", 'rb') as pem_in: pem_lines = pem_in.read() private_key = load_pem_private_key(pem_lines, None) ### DISCLAIMER:- Since NO ENCRYPTION is used in the key storage/formatting. Please DO NOT use this code in production environment. signing_key = jwk.JWK.from_pem( private_key.private_bytes( encoding=serialization.Encoding.PEM, format=serialization.PrivateFormat.PKCS8, encryption_algorithm=serialization.NoEncryption() ) ) signing_key.update({\"kid\": verification_key_guid}) attestation_jwt = jwt.JWT( header={ \"alg\": algorithm, \"kid\": verification_key_guid }, claims={ \"iss\": f\"http://api.cybrid.app/banks/{bank_guid}\", \"aud\": \"http://api.cybrid.app\", \"sub\": f\"http://api.cybrid.app/customers/{customer_guid}\", \"iat\": int(issued_at.timestamp()), \"exp\": int(expired_at.timestamp()), \"jti\": str(uuid.uuid4()) }, key=signing_key, algs=[algorithm] ) attestation_jwt.make_signed_token(signing_key) token = attestation_jwt.serialize(compact=True) print(\"Token is : \", token) ``` ## Attestation State | State | Description | |-------|-------------| | storing | The Platform is storing the attestation in our private store | | pending | The Platform is verifying the attestation's JWT | | verified | The Platform has verified the attestation and the customer is able to transact | | failed | The Platform was not able to verify the attestation and the customer is not able to transact | Required scope: **customers:write**201 - Identity Record created
400 - Invalid requests - malformed authentication header
401 - Unauthorized - Authentication failed,
403 - Invalid scope
- Parameters:
postIdentityRecordBankModel- The postIdentityRecordBankModel parameter- Returns:
- IdentityRecordBankModel
- Throws:
org.springframework.web.reactive.function.client.WebClientResponseException- if an error occurs while attempting to invoke the API
-
createIdentityRecordWithHttpInfo
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<IdentityRecordBankModel>> createIdentityRecordWithHttpInfo(PostIdentityRecordBankModel postIdentityRecordBankModel) throws org.springframework.web.reactive.function.client.WebClientResponseException
- Throws:
org.springframework.web.reactive.function.client.WebClientResponseException
-
getIdentityRecord
public reactor.core.publisher.Mono<IdentityRecordBankModel> getIdentityRecord(String identityRecordGuid) throws org.springframework.web.reactive.function.client.WebClientResponseException
Get Identity Record Retrieves an identity record. Required scope: **customers:read**200 - Identity Record found
400 - Invalid requests - malformed authentication header
401 - Unauthorized - Authentication failed,
403 - Invalid scope
404 - identity record not found
- Parameters:
identityRecordGuid- Identifier for the identity record.- Returns:
- IdentityRecordBankModel
- Throws:
org.springframework.web.reactive.function.client.WebClientResponseException- if an error occurs while attempting to invoke the API
-
getIdentityRecordWithHttpInfo
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<IdentityRecordBankModel>> getIdentityRecordWithHttpInfo(String identityRecordGuid) throws org.springframework.web.reactive.function.client.WebClientResponseException
- Throws:
org.springframework.web.reactive.function.client.WebClientResponseException
-
listIdentityRecords
public reactor.core.publisher.Mono<IdentityRecordListBankModel> listIdentityRecords(String customerGuid, BigInteger page, BigInteger perPage) throws org.springframework.web.reactive.function.client.WebClientResponseException
List Identity Records Retrieves a listing of identity records for a bank. Required scope: **customers:read**200 - list of identity records
400 - Invalid requests - malformed authentication header
401 - Unauthorized - Authentication failed,
403 - Invalid scope
- Parameters:
customerGuid- Comma separated customer identifier to list identity records for.page- The page parameterperPage- The perPage parameter- Returns:
- IdentityRecordListBankModel
- Throws:
org.springframework.web.reactive.function.client.WebClientResponseException- if an error occurs while attempting to invoke the API
-
listIdentityRecordsWithHttpInfo
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<IdentityRecordListBankModel>> listIdentityRecordsWithHttpInfo(String customerGuid, BigInteger page, BigInteger perPage) throws org.springframework.web.reactive.function.client.WebClientResponseException
- Throws:
org.springframework.web.reactive.function.client.WebClientResponseException
-
-