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

[CAT-1120] Improve readme, fix id photos list and regex in tasks definition #84

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions generators/java/okhttp-gson/templates/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ Webhook events payload needs to be verified before it can be accessed. Library a

```java
try {
WebhookEventVerifier verifier = new WebhookEventVerifier("_ABC123abc...3ABC123_");
WebhookEventVerifier verifier = new WebhookEventVerifier(
System.getenv("ONFIDO_WEBHOOK_SECRET_TOKEN")
);

String signature = "a0...760e";

WebhookEvent event = verifier.readPayload("{\"payload\":{\"r...3\"}}}", signature);
WebhookEvent event = verifier.readPayload("{\"payload\":{\"r...3\"}}", signature);
} catch( OnfidoInvalidSignatureError e ) {
// Invalid webhook signature
}
Expand Down
2 changes: 1 addition & 1 deletion generators/php/templates/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Webhook events payload needs to be verified before it can be accessed. Library a

```php
try {
$verifier = new Onfido\WebhookEventVerifier('_ABC123abc...3ABC123_');
$verifier = new Onfido\WebhookEventVerifier(getenv('ONFIDO_WEBHOOK_SECRET_TOKEN'));

$signature = 'a0...760e';

Expand Down
2 changes: 1 addition & 1 deletion generators/python/urllib3/templates/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Webhook events payload needs to be verified before it can be accessed. Library a

```python
try:
verifier = {{{packageName}}}.WebhookEventVerifier("_ABC123abc...3ABC123_")
verifier = {{{packageName}}}.WebhookEventVerifier(os.environ["ONFIDO_WEBHOOK_SECRET_TOKEN"])

signature = "a0...760e"

Expand Down
8 changes: 4 additions & 4 deletions generators/ruby/faraday/templates/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Configure with your API token, region and optional timeout (default value is 30)
require {{{gemName}}}

Onfido.configure do |config|
config.api_token = ENV["ONFIDO_API_TOKEN"]
config.api_token = ENV["ONFIDO_WEBHOOK_SECRET_TOKEN"]
config.region = config.region[:EU]
config.timeout = 30
end
Expand Down Expand Up @@ -78,9 +78,9 @@ Webhook events payload needs to be verified before it can be accessed. Library a
event = verifier.read_payload('{"payload":{"r...3"}}', signature)

rescue Onfido::OnfidoInvalidSignatureError => e
e.type
e.fields
e.response_code
e.type
e.fields
e.response_code
end
```

Expand Down
3 changes: 2 additions & 1 deletion generators/typescript-axios/templates/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ Webhook events payload needs to be verified before it can be accessed. Library a
```js
(async () => {
try {
const verifier = new WebhookEventVerifier("_ABC123abc...3ABC123_");
const token = process.env.ONFIDO_WEBHOOK_SECRET_TOKEN;
const verifier = new WebhookEventVerifier(token);
const signature = "a0...760e";

const event = verifier.readPayload(`{"payload":{"r...3"}}`, signature);
Expand Down
2 changes: 1 addition & 1 deletion paths/id_photos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ id_photos:
application/json:
schema:
type: object
title: ID Photos list
title: Id Photos list
required:
- id_photos
properties:
Expand Down
4 changes: 2 additions & 2 deletions schemas/tasks/definitions.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
task_id:
type: string
pattern: ^[0-9a-z-_]+$
pattern: ^[0-9a-z_-]+$
description: The identifier for the Task.
example: profile_123
task_def_id:
type: string
pattern: ^[0-9a-z-_]+$
pattern: ^[0-9a-z_-]+$
description: The identifier for the Task Definition.
example: task_123