Skip to content

Commit

Permalink
Deploying to gh-pages from @ ffeecc2 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
violog committed Jun 12, 2024
1 parent 299e7b9 commit 3071ee0
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 46 deletions.
102 changes: 78 additions & 24 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"Authorize"
],
"summary": "Request challenge",
"description": "Request challenge to generate AuthV2 proof with\n",
"description": "Request challenge to generate Query proof with\n",
"operationId": "challenge",
"parameters": [
{
Expand Down Expand Up @@ -207,7 +207,7 @@
"Authorize": {
"allOf": [
{
"$ref": "#/components/schemas/UserKey"
"$ref": "#/components/schemas/AuthorizeKey"
},
{
"type": "object",
Expand All @@ -225,18 +225,39 @@
"proof": {
"type": "object",
"format": "json.RawMessage",
"description": "JSON encoded ZK proof AuthV2 proof."
"description": "JSON-encoded Query ZK-proof."
}
}
}
}
}
]
},
"AuthorizeKey": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"example": "0x123...abc",
"pattern": "^0x[0-9a-fA-F]{64}$",
"description": "User nullifier 32 bytes"
},
"type": {
"type": "string",
"enum": [
"authorize"
]
}
}
},
"Challenge": {
"allOf": [
{
"$ref": "#/components/schemas/UserKey"
"$ref": "#/components/schemas/ChallengeKey"
},
{
"type": "object",
Expand All @@ -251,7 +272,7 @@
"properties": {
"challenge": {
"type": "string",
"description": "Base64 encoded challenge. Use it to generate AuthV2 ZK proof. Decode base64 string and convert into big-endian decimal number.",
"description": "Base64 encoded challenge. Use it to generate Query ZK-proof.\nDecode base64 string and convert into big-endian decimal number.\n",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
}
}
Expand All @@ -260,18 +281,34 @@
}
]
},
"ChallengeKey": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"example": "0x123...abc",
"pattern": "^0x[0-9a-fA-F]{64}$",
"description": "User nullifier 32 bytes"
},
"type": {
"type": "string",
"enum": [
"challenge"
]
}
}
},
"Claim": {
"description": "Authorized user personal data",
"type": "object",
"required": [
"nullifier"
],
"properties": {
"address": {
"type": "string",
"example": "0xF65F3f18D9087c4E35BAC5b9746492082e186872",
"description": "User EVM address hex-encoded"
},
"nullifier": {
"type": "string",
"example": "0x123...abc",
Expand Down Expand Up @@ -330,15 +367,15 @@
"type": "object",
"required": [
"token",
"tokenType"
"token_type"
],
"properties": {
"token": {
"type": "string",
"description": "Base64 encoded JWT",
"example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
},
"tokenType": {
"token_type": {
"type": "string",
"enum": [
"access",
Expand All @@ -350,7 +387,7 @@
"Token": {
"allOf": [
{
"$ref": "#/components/schemas/UserKey"
"$ref": "#/components/schemas/TokenKey"
},
{
"type": "object",
Expand All @@ -360,15 +397,15 @@
"properties": {
"attributes": {
"required": [
"accessToken",
"refreshToken"
"access_token",
"refresh_token"
],
"type": "object",
"properties": {
"accessToken": {
"access_token": {
"$ref": "#/components/schemas/JWT"
},
"refreshToken": {
"refresh_token": {
"$ref": "#/components/schemas/JWT"
}
}
Expand All @@ -377,7 +414,7 @@
}
]
},
"UserKey": {
"TokenKey": {
"type": "object",
"required": [
"id",
Expand All @@ -393,19 +430,15 @@
"type": {
"type": "string",
"enum": [
"request-authorize",
"request-challenge",
"token",
"validation",
"challenge"
"token"
]
}
}
},
"ValidationResult": {
"allOf": [
{
"$ref": "#/components/schemas/UserKey"
"$ref": "#/components/schemas/ValidationResultKey"
},
{
"type": "object",
Expand All @@ -430,6 +463,27 @@
}
}
]
},
"ValidationResultKey": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"example": "0x123...abc",
"pattern": "^0x[0-9a-fA-F]{64}$",
"description": "User nullifier 32 bytes"
},
"type": {
"type": "string",
"enum": [
"validation"
]
}
}
}
},
"responses": {
Expand Down
83 changes: 61 additions & 22 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ paths:
- Authorize
summary: Request challenge
description: |
Request challenge to generate AuthV2 proof with
Request challenge to generate Query proof with
operationId: challenge
parameters:
- $ref: '#/components/parameters/pathNullifier'
Expand Down Expand Up @@ -132,7 +132,7 @@ components:
schemas:
Authorize:
allOf:
- $ref: '#/components/schemas/UserKey'
- $ref: '#/components/schemas/AuthorizeKey'
- type: object
x-go-is-request: true
required:
Expand All @@ -146,10 +146,25 @@ components:
proof:
type: object
format: json.RawMessage
description: JSON encoded ZK proof AuthV2 proof.
description: JSON-encoded Query ZK-proof.
AuthorizeKey:
type: object
required:
- id
- type
properties:
id:
type: string
example: 0x123...abc
pattern: '^0x[0-9a-fA-F]{64}$'
description: User nullifier 32 bytes
type:
type: string
enum:
- authorize
Challenge:
allOf:
- $ref: '#/components/schemas/UserKey'
- $ref: '#/components/schemas/ChallengeKey'
- type: object
required:
- attributes
Expand All @@ -160,18 +175,31 @@ components:
properties:
challenge:
type: string
description: Base64 encoded challenge. Use it to generate AuthV2 ZK proof. Decode base64 string and convert into big-endian decimal number.
description: |
Base64 encoded challenge. Use it to generate Query ZK-proof.
Decode base64 string and convert into big-endian decimal number.
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9
ChallengeKey:
type: object
required:
- id
- type
properties:
id:
type: string
example: 0x123...abc
pattern: '^0x[0-9a-fA-F]{64}$'
description: User nullifier 32 bytes
type:
type: string
enum:
- challenge
Claim:
description: Authorized user personal data
type: object
required:
- nullifier
properties:
address:
type: string
example: '0xF65F3f18D9087c4E35BAC5b9746492082e186872'
description: User EVM address hex-encoded
nullifier:
type: string
example: 0x123...abc
Expand Down Expand Up @@ -216,35 +244,35 @@ components:
type: object
required:
- token
- tokenType
- token_type
properties:
token:
type: string
description: Base64 encoded JWT
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
tokenType:
token_type:
type: string
enum:
- access
- refresh
Token:
allOf:
- $ref: '#/components/schemas/UserKey'
- $ref: '#/components/schemas/TokenKey'
- type: object
required:
- attributes
properties:
attributes:
required:
- accessToken
- refreshToken
- access_token
- refresh_token
type: object
properties:
accessToken:
access_token:
$ref: '#/components/schemas/JWT'
refreshToken:
refresh_token:
$ref: '#/components/schemas/JWT'
UserKey:
TokenKey:
type: object
required:
- id
Expand All @@ -258,14 +286,10 @@ components:
type:
type: string
enum:
- request-authorize
- request-challenge
- token
- validation
- challenge
ValidationResult:
allOf:
- $ref: '#/components/schemas/UserKey'
- $ref: '#/components/schemas/ValidationResultKey'
- type: object
required:
- attributes
Expand All @@ -279,6 +303,21 @@ components:
type: array
items:
$ref: '#/components/schemas/Claim'
ValidationResultKey:
type: object
required:
- id
- type
properties:
id:
type: string
example: 0x123...abc
pattern: '^0x[0-9a-fA-F]{64}$'
description: User nullifier 32 bytes
type:
type: string
enum:
- validation
responses:
internalError:
description: Internal server error
Expand Down

0 comments on commit 3071ee0

Please sign in to comment.