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

Adding trust in transactions using credentials #468

Open
wants to merge 15 commits into
base: Verifiable-Credentials
Choose a base branch
from
Open
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
247 changes: 245 additions & 2 deletions api/transaction/build/transaction.yaml
Original file line number Diff line number Diff line change
@@ -366,6 +366,34 @@ paths:
responses:
default:
$ref: '#/paths/~1init/post/responses/default'
/cred:
post:
tags:
- Beckn Provider Platform (BPP)
description: Request for credentials
requestBody:
content:
application/json:
schema:
type: object
properties:
context:
allOf:
- $ref: '#/components/schemas/Context'
- properties:
action:
enum:
- cred
required:
- action
message:
$ref: '#/components/schemas/CredentialRequest'
required:
- context
- message
responses:
default:
$ref: '#/paths/~1init/post/responses/default'
/on_search:
post:
tags:
@@ -704,6 +732,35 @@ paths:
responses:
default:
$ref: '#/paths/~1init/post/responses/default'
/on_cred:
post:
tags:
- Beckn Application Platform (BAP)
description: Callback for a credential request
requestBody:
content:
application/json:
schema:
type: object
properties:
context:
allOf:
- $ref: '#/components/schemas/Context'
- properties:
action:
enum:
- on_cred
required:
- action
message:
$ref: '#/components/schemas/CredentialResponse'
error:
$ref: '#/components/schemas/Error'
required:
- context
responses:
default:
$ref: '#/paths/~1init/post/responses/default'
components:
securitySchemes:
SubscriberAuth:
@@ -1000,18 +1057,85 @@ components:
type: string
description: Country code as per ISO 3166-1 and ISO 3166-2 format
Credential:
description: Describes a credential of an entity - Person or Organization
description: 'Describes a credential of an entity - Person, Organization, Item, Payment etc'
type: object
properties:
id:
type: string
type:
type: string
default: VerifiableCredential
description:
$ref: '#/components/schemas/Descriptor'
docs:
description: The Documents associated with the credential.
type: array
items:
$ref: '#/components/schemas/Document'
media:
description: The Media associated with the credential.
type: array
items:
$ref: '#/components/schemas/MediaFile'
url:
description: URL of the credential
type: string
format: uri
verifiableCredential:
$ref: '#/components/schemas/VC'
CredentialRequest:
description: Describes the schema used to request for a proof from an entity
type: object
properties:
asset:
type: object
properties:
type:
type: string
id:
type: string
requested_proofs:
type: array
items:
type: object
properties:
descriptor:
$ref: '#/components/schemas/Descriptor'
likes:
type: array
items:
$ref: '#/components/schemas/Descriptor'
xinput:
description: A requester can send a form which can be filled by the sender with relevant details.
$ref: '#/components/schemas/XInput'
CredentialResponse:
description: 'Describes a credential of an entity - Person, Organization, Item, Payment etc'
type: object
properties:
asset:
type: object
properties:
type:
type: string
id:
type: string
proofs:
type: object
properties:
requested:
type: array
items:
type: object
properties:
descriptor:
$ref: '#/components/schemas/Descriptor'
likes:
type: array
items:
$ref: '#/components/schemas/Descriptor'
attachments:
type: array
items:
$ref: '#/components/schemas/Credential'
Customer:
description: Describes a customer buying/availing a product or a service
type: object
@@ -1076,6 +1200,11 @@ components:
type: string
enum:
- application/pdf
- text/plain
- image/jpeg
- video/mp4
- audio/wav
- application/zip
Domain:
description: 'Described the industry sector or sub-sector. The network policy should contain codes for all the industry sectors supported by the network. Domains can be created in varying levels of granularity. The granularity of a domain can be decided by the participants of the network. Too broad domains will result in irrelevant search broadcast calls to BPPs that don''t have services supporting the domain. Too narrow domains will result in a large number of registry entries for each BPP. It is recommended that network facilitators actively collaborate with various working groups and network participants to carefully choose domain codes keeping in mind relevance, performance, and opportunity cost. It is recommended that networks choose broad domains like mobility, logistics, healthcare etc, and progressively granularize them as and when the number of network participants for each domain grows large.'
type: object
@@ -1199,6 +1328,10 @@ components:
path:
description: The physical path taken by the agent that can be rendered on a map. The allowed format of this property can be set by the network.
type: string
creds:
type: array
items:
$ref: '#/components/schemas/Credential'
tags:
type: array
items:
@@ -1465,6 +1598,10 @@ components:
recommended:
description: Whether this item is a recommended item to a response
type: boolean
creds:
type: array
items:
$ref: '#/components/schemas/Credential'
ttl:
$ref: '#/components/schemas/Duration'
tags:
@@ -1672,6 +1809,10 @@ components:
description: The date-time of updated of this order
type: string
format: date-time
creds:
type: array
items:
$ref: '#/components/schemas/Credential'
xinput:
description: Additional input required from the customer to confirm this order
allOf:
@@ -1700,6 +1841,10 @@ components:
- $ref: '#/components/schemas/City'
contact:
$ref: '#/components/schemas/Contact'
creds:
type: array
items:
$ref: '#/components/schemas/Credential'
Payment:
description: 'Describes the terms of settlement between the BAP and the BPP for a single transaction. When instantiated, this object contains <ol><li>the amount that has to be settled,</li><li>The payment destination destination details</li><li>When the settlement should happen, and</li><li>A transaction reference ID</li></ol>. During a transaction, the BPP reserves the right to decide the terms of payment. However, the BAP can send its terms to the BPP first. If the BPP does not agree to those terms, it must overwrite the terms and return them to the BAP. If overridden, the BAP must either agree to the terms sent by the BPP in order to preserve the provider''s autonomy, or abort the transaction. In case of such disagreements, the BAP and the BPP can perform offline negotiations on the payment terms. Once an agreement is reached, the BAP and BPP can resume transactions.'
type: object
@@ -1757,6 +1902,10 @@ components:
type: array
items:
$ref: '#/components/schemas/TagGroup'
creds:
type: array
items:
$ref: '#/components/schemas/Credential'
Person:
description: Describes a person as any individual
type: object
@@ -1881,6 +2030,10 @@ components:
type: boolean
ttl:
$ref: '#/components/schemas/Duration'
creds:
type: array
items:
$ref: '#/components/schemas/Credential'
tags:
type: array
items:
@@ -2181,6 +2334,96 @@ components:
enum:
- active
- inactive
VC:
description: Describes a Verifiable Credential
type: object
properties:
'@context':
type: array
items:
type: string
id:
description: 'A unique identifier for the credential (e.g., UUID or URI).'
type: string
type:
description: Types of the credential.
type: array
items:
type: string
description:
anyOf:
- type: string
- type: object
- type: array
items:
type: object
issuer:
anyOf:
- type: string
- type: object
issuanceDate:
type: string
description: The date when the credential was issued.
validFrom:
type: string
description: 'The expiration date of the credential, if applicable.'
validUntil:
type: string
description: 'The expiration date of the credential, if applicable.'
credentialSubject:
anyOf:
- type: string
- type: object
- type: array
items:
type: string
- type: array
items:
type: object
credentialSchema:
anyOf:
- type: object
- type: array
items:
type: object
proof:
anyOf:
- type: object
- type: array
items:
type: object
termsOfUse:
anyOf:
- type: string
- type: object
- type: array
items:
type: string
- type: array
items:
type: object
credentialStatus:
anyOf:
- type: string
- type: object
- type: array
items:
type: string
- type: array
items:
type: object
evidence:
anyOf:
- type: string
- type: object
- type: array
items:
type: string
- type: array
items:
type: object
credentialHash:
type: string
Vehicle:
description: 'Describes a vehicle is a device that is designed or used to transport people or cargo over land, water, air, or through space.<br>This has properties like category, capacity, make, model, size,variant,color,energy_type,registration'
type: object
27 changes: 26 additions & 1 deletion api/transaction/components/index.yaml
Original file line number Diff line number Diff line change
@@ -147,7 +147,19 @@ paths:
responses:
default:
$ref: "./io/Response.yaml"

/cred:
post:
tags:
- Beckn Provider Platform (BPP)
description: Request for credentials
requestBody:
content:
application/json:
schema:
$ref : "./io/Cred.yaml"
responses:
default:
$ref: "./io/Response.yaml"
/on_search:
post:
tags:
@@ -286,6 +298,19 @@ paths:
responses:
default:
$ref: "./io/Response.yaml"
/on_cred:
post:
tags:
- Beckn Application Platform (BAP)
description: Callback for a credential request
requestBody:
content:
application/json:
schema:
$ref: "./io/OnCred.yaml"
responses:
default:
$ref: "./io/Response.yaml"
components:
securitySchemes:
SubscriberAuth:
16 changes: 16 additions & 0 deletions api/transaction/components/io/Cred.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type: object
properties:
context:
allOf:
- $ref: "../../../../schema/Context.yaml"
- properties:
action:
enum:
- cred
required:
- action
message:
$ref: "../../../../schema/CredentialRequest.yaml"
required:
- context
- message
Loading