ockam_api 0.8.0

Ockam's request-response API
Documentation
;;; NOTE: Many types have at key 0 a type identifier (aka type tag). This is
;;; a randomly generated number that helps in tests to ensure that the CBOR
;;; item is the type expected.

;;; Request Header ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

request = {
    ?0: 7586022,
     1: id,
     2: path,
     3: method,
     4: has_body
}

id       = uint
re       = uint
path     = text
has_body = bool

method = 0 ;; GET
       / 1 ;; POST
       / 2 ;; PUT
       / 3 ;; DELETE
       / 4 ;; PATCH

;;; Response Header ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

response = {
    ?0: 9750358,
     1: id,
     2: re,
     3: status,
     4: has_body
}

status = 200 ;; OK
       / 400 ;; Bad request
       / 404 ;; Not found
       / 405 ;; Method not allowed
       / 500 ;; Internal server error
       / 501 ;; Not implemented

;;; Error ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

error = {
    ?0: 5359172,
     1: path,
    ?2: method,
    ?3: message
}

message = text

;;; Authenticated attributes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

attributes = {
    ?0: 4724285,
     1: {+ text => bytes }
}

attribute = {
    ?0: 6844116,
     1: value
}

value = bytes

;;; Spaces ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

space = {
   ?0: 7574645
    1: space_id
    2: space_name
}

spaces = [* space]

create_space = {
   ?0: 3888657,
    1: space_name
}

space_id   = text
space_name = text

;;; Projects ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

project = {
   ?0: 9056532,
    1: project_id,
    2: project_name,
    3: space_name,
    4: [+ service_name],
    5: access_route
}

projects = [* project]

create_project = {
    ?0: 8669570,
    1: project_name,
    2: [+ service_name]
}

project_id   = text
project_name = text
service_name = text
access_route = bytes

;;; Identity ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

identity_create_response = {
    ?0: 3500430,
     1: identity,
     2: identity_id,
}

validate_identity_change_history_request = {
    ?0: 4245404,
     1: identity,
}

validate_identity_change_history_response = {
    ?0: 3500430,
     1: identity_id,
}

compare_identity_change_history_request = {
    ?0: 7300740,
     1: current_identity,
     2: known_identity,
}

create_signature_request = {
    ?0: 1019956,
     1: identity,
     2: data,
}

create_signature_response = {
    ?0: 2592832,
     1: signature,
}

verify_signature_request = {
    ?0: 7550780,
     1: signer_identity,
     2: data,
     3: signature,
}

verify_signature_response = {
    ?0: 1236745,
     1: verified,
}

identity         = bytes
current_identity = bytes
known_identity   = bytes
signer_identity  = bytes
identity_id      = text
signature        = bytes
peer_identity_id = text
data             = bytes
verified         = bool

;;; Enroll ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

enrollment_token = {
    ?0: 8932763,
     1: token
}

token = text

request_enrollment_token = {
    ?0: 8560526,
     1: attributes
}

;;; Invitation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

invitation = {
    ?0: 7088378,
     1: invitation_id,
     2: inviter,
     3: invitee,
     4: scope,
     5: state,
     6: space_id,
    ?7: project_id
}

invitations = [* invitation]

create_invitation = {
    ?0: 1886440,
     1: invitee,
     2: scope,
     3: space_id,
    ?4: project_id
}

invitation_id = text
inviter       = text
invitee       = text
scope         = invitation_scope
state         = invitation_state

invitation_scope = 0 ;; Space
                 / 1 ;; Project

invitation_state = 0 ;; Pending
                / 1 ;; Accepted
                / 2 ;; Rejected