2021-12-20 21:49:59 +00:00
|
|
|
openapi: 3.0.0
|
|
|
|
info:
|
|
|
|
description: |
|
|
|
|
DataBag provides storage for decentralized identity based self-hosting apps.
|
|
|
|
It is intended to support sharing of personal data and hosting group
|
|
|
|
conversations.
|
|
|
|
version: "0.0.1"
|
|
|
|
title: DataBag
|
|
|
|
termsOfService: 'http://swagger.io/terms/'
|
|
|
|
contact:
|
|
|
|
email: roland.osborne@gmail.com
|
|
|
|
license:
|
|
|
|
name: Apache 2.0
|
|
|
|
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
|
|
|
|
tags:
|
|
|
|
- name: revision
|
|
|
|
description: websocket endpoint for receiving module revision events
|
|
|
|
- name: portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: account creation and configuration for portal backend. supports app attachment
|
|
|
|
- name: registry
|
|
|
|
description: listing of public accounts
|
2021-12-20 21:49:59 +00:00
|
|
|
- name: profile
|
|
|
|
description: getting and setting of the public profile
|
|
|
|
- name: content
|
|
|
|
description: posting and listing of personal subjects, group and tag managment
|
|
|
|
- name: contact
|
|
|
|
description: connection to other identities, hook receiver
|
|
|
|
- name: sharing
|
|
|
|
description: sharing personal subjects, associates content and contacts
|
|
|
|
- name: converstaion
|
|
|
|
description: group sharing of subjects
|
|
|
|
|
|
|
|
paths:
|
|
|
|
|
|
|
|
/revision:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- revision
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Websocket placeholder endpoint for receiving revision updates
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: websocket
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: Awaiting announce
|
|
|
|
|
|
|
|
/portal/configurable:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Check if portal params have been set
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: get-config
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: success
|
|
|
|
'405':
|
|
|
|
description: admin already configured
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/portal/config:
|
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Set admin password and node domain
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: set-config
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
parameters:
|
|
|
|
- name: domain
|
|
|
|
in: query
|
|
|
|
description: domain of node
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: success
|
|
|
|
'405':
|
|
|
|
description: admin already configured
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
put:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Set portal domain
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: set-domain
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
parameters:
|
|
|
|
- name: domain
|
|
|
|
in: query
|
|
|
|
description: domain of node
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: success
|
|
|
|
'401':
|
|
|
|
description: authentication error
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/portal/claimable:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Check if username is available
|
|
|
|
operationId: check-username
|
|
|
|
security:
|
|
|
|
- bearerAuth: []
|
|
|
|
parameters:
|
|
|
|
- name: username
|
|
|
|
in: query
|
|
|
|
description: username to check
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: success
|
|
|
|
'401':
|
|
|
|
description: authentication error
|
|
|
|
'405':
|
|
|
|
description: username already taken
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/portal/profile:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Get public profile object
|
|
|
|
operationId: get-profile
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Profile'
|
|
|
|
'401':
|
|
|
|
description: authentication error
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Add a new portal
|
|
|
|
operationId: set-profile
|
|
|
|
security:
|
|
|
|
- bearerAuth: []
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'201':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Profile'
|
|
|
|
'400':
|
|
|
|
description: invalid handle or password
|
|
|
|
'401':
|
|
|
|
description: invalid bearer token
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/portal/profile/authenication:
|
2021-12-20 22:07:46 +00:00
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Generate authentication update token
|
2021-12-20 22:07:46 +00:00
|
|
|
operationId: prepare-authentication
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: authentication ready
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
'401':
|
|
|
|
description: invalid handle or password
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
2021-12-20 21:49:59 +00:00
|
|
|
put:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Update authentication with extra auth header
|
2021-12-20 22:07:46 +00:00
|
|
|
operationId: set-authentication
|
2021-12-20 21:49:59 +00:00
|
|
|
security:
|
2021-12-20 22:07:46 +00:00
|
|
|
- bearerAuth: []
|
2021-12-20 21:49:59 +00:00
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: authentication set
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Profile'
|
|
|
|
'400':
|
|
|
|
description: invalid new handle or password
|
|
|
|
'401':
|
|
|
|
description: invalid handle or password
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
2021-12-21 08:13:48 +00:00
|
|
|
/portal/profile/attachment:
|
|
|
|
post:
|
2021-12-20 21:49:59 +00:00
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Generate attach token
|
|
|
|
operationId: create-attach-token
|
2021-12-20 21:49:59 +00:00
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'201':
|
|
|
|
description: generated
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
2021-12-21 08:13:48 +00:00
|
|
|
put:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Apply attach token
|
|
|
|
operationId: apply-attach-token
|
|
|
|
security:
|
|
|
|
- bearerAuth: []
|
|
|
|
responses:
|
|
|
|
'201':
|
|
|
|
description: generated
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
'401':
|
|
|
|
description: invalid token
|
|
|
|
'406':
|
|
|
|
description: app limit reached
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
requestBody:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/AppData'
|
|
|
|
|
|
|
|
/portal/profile/apps:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Get list of attached apps
|
|
|
|
operationId: get-apps
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'404':
|
|
|
|
description: handle not found
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/portal/profile/config:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Get account config
|
|
|
|
operationId: get-account-config
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/AccountConfig'
|
|
|
|
'401':
|
|
|
|
description: authentication error
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
put:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Set account config
|
|
|
|
operationId: set-account-config
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/AccountConfig'
|
|
|
|
'401':
|
|
|
|
description: authentication error
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
2021-12-20 21:49:59 +00:00
|
|
|
/portal/token:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Check if bearer token is valid
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: check-token
|
|
|
|
security:
|
|
|
|
- bearerAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: success
|
|
|
|
'401':
|
|
|
|
description: invalid token
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
put:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Create password reset token
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: set-account
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
parameters:
|
|
|
|
- name: guid
|
|
|
|
in: query
|
|
|
|
description: id of profile to access
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
'201':
|
|
|
|
description: generated
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'404':
|
|
|
|
description: unknown portal
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
post:
|
|
|
|
tags:
|
|
|
|
- portal
|
2021-12-21 08:13:48 +00:00
|
|
|
description: Create new portal token
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: add-account
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'201':
|
|
|
|
description: generated
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/portal/accounts:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Get list of portals
|
|
|
|
operationId: get-accounts
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
type: string
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'404':
|
|
|
|
description: handle not found
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/portal/accounts/{guid}:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Get profile of account
|
|
|
|
operationId: get-account
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
parameters:
|
|
|
|
- name: guid
|
|
|
|
in: path
|
|
|
|
description: id of account to access
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/Profile'
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'404':
|
|
|
|
description: account not found
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
delete:
|
|
|
|
tags:
|
|
|
|
- portal
|
|
|
|
description: Remove account from node
|
|
|
|
operationId: remove-account
|
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
parameters:
|
|
|
|
- name: guid
|
|
|
|
in: path
|
|
|
|
description: id of account to delete
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
'401':
|
|
|
|
description: invalid authentication
|
|
|
|
'404':
|
|
|
|
description: account not found
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
2021-12-21 08:13:48 +00:00
|
|
|
/registry/accounts:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- registry
|
|
|
|
description: Get list of publically searchable profiles
|
|
|
|
operationId: get-public-profiles
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
type: array
|
|
|
|
items:
|
|
|
|
$ref: '#/components/schemas/Profile'
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'404':
|
|
|
|
description: account not found
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
|
|
|
/registry/accounts/{guid}:
|
|
|
|
get:
|
|
|
|
tags:
|
|
|
|
- registry
|
|
|
|
description: Get public profile of specified account
|
|
|
|
operationId: get-profile-message
|
|
|
|
parameters:
|
|
|
|
- name: guid
|
|
|
|
in: path
|
|
|
|
description: id of specified account
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
responses:
|
|
|
|
'200':
|
|
|
|
description: successful operation
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/DataMessage'
|
|
|
|
'401':
|
|
|
|
description: invalid password
|
|
|
|
'404':
|
|
|
|
description: account not found
|
|
|
|
'500':
|
|
|
|
description: internal server error
|
|
|
|
|
2021-12-20 21:49:59 +00:00
|
|
|
/sample:
|
|
|
|
put:
|
|
|
|
tags:
|
|
|
|
- sample
|
2021-12-21 08:13:48 +00:00
|
|
|
description: sample
|
2021-12-20 21:49:59 +00:00
|
|
|
operationId: sample
|
|
|
|
responses:
|
|
|
|
'400':
|
|
|
|
description: sample
|
|
|
|
requestBody:
|
|
|
|
$ref: '#/components/requestBodies/Sample'
|
|
|
|
|
|
|
|
externalDocs:
|
|
|
|
description: Find out more about Swagger
|
|
|
|
url: 'http://swagger.io'
|
|
|
|
|
|
|
|
components:
|
|
|
|
schemas:
|
|
|
|
|
|
|
|
Announce:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- appToken
|
|
|
|
properties:
|
|
|
|
appToken:
|
|
|
|
type: string
|
|
|
|
|
|
|
|
Passcode:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- value
|
|
|
|
properties:
|
|
|
|
value:
|
|
|
|
type: string
|
|
|
|
|
|
|
|
Revsion:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- profile
|
|
|
|
- content
|
|
|
|
- labels
|
|
|
|
- sharing
|
|
|
|
- contact
|
|
|
|
- dialogue
|
|
|
|
- insight
|
|
|
|
properties:
|
|
|
|
profile:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
content:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
labels:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
sharing:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
contact:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
dialogue:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
insight:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
|
|
|
|
Profile:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- guid
|
2021-12-21 08:13:48 +00:00
|
|
|
- data
|
2021-12-20 21:49:59 +00:00
|
|
|
- revision
|
|
|
|
- node
|
|
|
|
properties:
|
2021-12-21 08:13:48 +00:00
|
|
|
guid:
|
|
|
|
type: string
|
|
|
|
data:
|
|
|
|
$ref: '#/components/schemas/ProfileData'
|
|
|
|
revision:
|
|
|
|
type: integer
|
|
|
|
format: int64
|
|
|
|
node:
|
|
|
|
type: string
|
|
|
|
|
|
|
|
ProfileData:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
handle:
|
2021-12-20 21:49:59 +00:00
|
|
|
type: string
|
|
|
|
name:
|
|
|
|
type: string
|
|
|
|
description:
|
|
|
|
type: string
|
2021-12-21 08:13:48 +00:00
|
|
|
image:
|
|
|
|
type: string
|
|
|
|
format: base64 encoded data
|
2021-12-20 21:49:59 +00:00
|
|
|
location:
|
|
|
|
type: string
|
2021-12-21 08:13:48 +00:00
|
|
|
|
|
|
|
AccountConfig:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
searchable:
|
|
|
|
type: boolean
|
|
|
|
|
|
|
|
App:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- appId
|
|
|
|
- appData
|
|
|
|
- attached
|
|
|
|
properties:
|
|
|
|
appId:
|
|
|
|
type: string
|
|
|
|
appData:
|
|
|
|
$ref: '#/components/schemas/AppData'
|
|
|
|
attached:
|
2021-12-20 21:49:59 +00:00
|
|
|
type: integer
|
2021-12-21 08:13:48 +00:00
|
|
|
format: int32
|
|
|
|
|
|
|
|
AppData:
|
|
|
|
type: object
|
|
|
|
properties:
|
|
|
|
name:
|
2021-12-20 21:49:59 +00:00
|
|
|
type: string
|
2021-12-21 08:13:48 +00:00
|
|
|
description:
|
|
|
|
type: string
|
|
|
|
url:
|
|
|
|
type: string
|
|
|
|
image:
|
|
|
|
type: string
|
|
|
|
format: base64 encoded image
|
|
|
|
|
|
|
|
DataMessage:
|
|
|
|
type: object
|
|
|
|
required:
|
|
|
|
- message
|
|
|
|
- messageType
|
|
|
|
- keyType
|
|
|
|
- publicKey
|
|
|
|
- signature
|
|
|
|
properties:
|
|
|
|
messageTyep:
|
|
|
|
type: string
|
|
|
|
enum: [OpenConnection, CloseConnection, Profile]
|
|
|
|
format: type of key
|
|
|
|
message:
|
|
|
|
type: string
|
|
|
|
format: base64 encoded object
|
|
|
|
keyType:
|
|
|
|
type: string
|
|
|
|
enum: [RSA4096, RSA2048]
|
|
|
|
format: type of key
|
|
|
|
publicKey:
|
|
|
|
type: string
|
|
|
|
format: base64 encoding of account key
|
|
|
|
|
2021-12-20 21:49:59 +00:00
|
|
|
requestBodies:
|
|
|
|
|
|
|
|
Sample:
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
2021-12-21 08:13:48 +00:00
|
|
|
$ref: '#/components/schemas/Profile'
|
2021-12-20 21:49:59 +00:00
|
|
|
description: Sample
|
|
|
|
required: true
|
|
|
|
|
|
|
|
securitySchemes:
|
|
|
|
|
|
|
|
basicAuth:
|
|
|
|
type: http
|
|
|
|
scheme: basic
|
|
|
|
|
|
|
|
bearerAuth:
|
|
|
|
type: http
|
|
|
|
scheme: bearer
|