Skip to content

Commit

Permalink
Merge pull request #9 from Cybersecurity-LINKS/docs-mediterraneus
Browse files Browse the repository at this point in the history
Update main
  • Loading branch information
lucagiorgino committed Mar 21, 2024
2 parents c4fcd6b + 3ba361b commit ae3183e
Show file tree
Hide file tree
Showing 12 changed files with 14,362 additions and 4,698 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati

### Local Development

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

```bash
npm run start
```
$ npm run start

The following command will generate API docs for all of the OpenAPI specifications referenced in your `docusaurus-plugin-openapi-docs` config.
```bash
npx docusaurus gen-api-docs all
```
For more commands look here: [OpenAPI Docs](https://docusaurus-openapi.tryingpan.dev/#generating-openapi-docs)

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
224 changes: 224 additions & 0 deletions apis/spec/connector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
openapi: '3.0.1'
info:
version: '1.0.0'
title: 'Connector API'
description: This document specifies the REST API for the Connector service.
externalDocs:
description: Github
url: https://github.com/Cybersecurity-LINKS/mediterraneus-client-side
servers:
- url: http://localhost:1234
tags:
- name: Identities
description: Everything about user identities.
- name: Assets
description: Everything about user assets.
paths:
# Identities APIs
/identities:
post:
summary: Creates a user identity.
tags:
- Identities
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IdentityRequest'
responses:
'201':
description: Created
/identities/{ethAddress}:
parameters:
- name: ethAddress
description: The unique identifier of the spacecraft
in: path
required: true
schema:
$ref: '#/components/schemas/ethAddress'
get:
summary: Read a spacecraft
tags:
- Identities
responses:
200:
description: The spacecraft corresponding to the provided `ethAddress`
content:
application/json:
schema:
$ref: '#/components/schemas/Spacecraft'
404:
description: No spacecraft found for the provided `ethAddress`
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
500:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/identities/{ethAddress}/sign-data:
parameters:
- name: ethAddress
description: The unique identifier of the spacecraft
in: path
required: true
schema:
$ref: '#/components/schemas/ethAddress'
post:
summary: Creates a user identity.
tags:
- Identities
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IdentityRequest'
responses:
'201':
description: Created
/identities/{ethAddress}/gen-presentation:
parameters:
- name: ethAddress
description: The unique identifier of the spacecraft
in: path
required: true
schema:
$ref: '#/components/schemas/ethAddress'
post:
summary: Creates a user identity.
tags:
- Identities
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IdentityRequest'
responses:
'201':
description: Created
# Assets APIs
/assets:
post:
summary: Upload an asset of the user
tags:
- Assets
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/IdentityRequest'
responses:
'201':
description: Created
get:
summary: Upload an asset of the user
tags:
- Assets
responses:
'201':
description: Created
/assets/{assetId}:
parameters:
- name: assetId
description: The unique identifier of the asset
in: path
required: true
schema:
$ref: '#/components/schemas/assetId'
get:
summary: Upload an asset of the user
tags:
- Assets
responses:
'201':
description: Created
patch:
summary: Upload an asset of the user
tags:
- Assets
responses:
'201':
description: Created
/assets/{assetId}/challenge:
parameters:
- name: assetId
description: The unique identifier of the asset
in: path
required: true
schema:
$ref: '#/components/schemas/assetId'
get:
summary: Upload an asset of the user
tags:
- Assets
responses:
'201':
description: Created
/assets/{assetId}/download:
parameters:
- name: assetId
description: The unique identifier of the asset
in: path
required: true
schema:
$ref: '#/components/schemas/assetId'
post:
summary: Upload an asset of the user
tags:
- Assets
responses:
'201':
description: Created
components:
schemas:
ethAddress:
description: The unique identifier of a spacecraft
type: string
assetId:
description: The unique identifier of an asset
type: string
Spacecraft:
type: object
required:
- id
- name
- type
properties:
id:
$ref: '#/components/schemas/ethAddress'
name:
type: string
type:
type: string
enum:
- capsule
- probe
- satellite
- spaceplane
- station
description:
type: string
IdentityRequest:
type: object
Error:
type: object
required:
- message
properties:
message:
description: A human readable error message
type: string
securitySchemes:
ApiKey:
type: apiKey
in: header
name: X-Api-Key
security:
- ApiKey: []
119 changes: 119 additions & 0 deletions apis/spec/issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
openapi: '3.0.0'
info:
version: '1.0.0'
title: 'Issuer API'
description: This document specifies the REST API for the Issuer service.
externalDocs:
description: Github
url: https://github.com/Cybersecurity-LINKS/mediterraneus-issuer-rs
servers:
- url: http://localhost:3213/api
tags:
- name: Credentials
description: Everything about Verifiable Credentials.
paths:
/challenges:
get:
summary: Get a challenge that the client should sign and send back in a short time.
parameters:
- in: query
name: did
description: The did of the user who have to sign the challenge.
required: true
schema:
$ref: '#/components/schemas/did'
responses:
200:
description: The challenge to be signed.
content:
application/json:
schema:
$ref: '#/components/schemas/Challenge'
429:
description: Too Many Requests
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
500:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/credentials:
post:
summary: Get a challenge that the client should sign and send back in a short time.
parameters:
- in: query
name: did
description: The did of the user who have to sign the challenge.
required: true
schema:
$ref: '#/components/schemas/did'
responses:
'200':
description: The spacecraft corresponding to the provided `spacecraftId`
content:
application/json:
schema:
$ref: '#/components/schemas/Spacecraft'
404:
description: No spacecraft found for the provided `spacecraftId`
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
500:
description: Unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
did:
description: The unique identifier of a spacecraft
type: string
Challenge:
description: The unique identifier of a spacecraft
type: string
SpacecraftId:
description: The unique identifier of a spacecraft
type: string
Spacecraft:
type: object
required:
- id
- name
- type
properties:
id:
$ref: '#/components/schemas/SpacecraftId'
name:
type: string
type:
type: string
enum:
- capsule
- probe
- satellite
- spaceplane
- station
description:
type: string
Error:
type: object
required:
- message
properties:
message:
description: A human readable error message
type: string
# securitySchemes:
# ApiKey:
# type: apiKey
# in: header
# name: X-Api-Key
# security:
# - ApiKey: []
Loading

0 comments on commit ae3183e

Please sign in to comment.