Skip to content

Commit

Permalink
add a bunch of new endpoints, although not fully built out
Browse files Browse the repository at this point in the history
also:
* all tests are expected to return a list of errors, or an empty list or nil if it passes
* base64 encode/decode tests
* base58 encode/decode tests (using github.com/mr-tron/base58 library to validate - same as ssi-service)
* sha256 encode test
  • Loading branch information
finn-block committed Oct 18, 2023
1 parent 72bd97f commit 32db7e7
Show file tree
Hide file tree
Showing 9 changed files with 3,798 additions and 261 deletions.
6 changes: 3 additions & 3 deletions cmd/web5-spec-test/reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ var templates = template.Must(template.New("").ParseFS(reportTemplateFS, "report

type Report struct {
TestServerID openapi.TestServerID
Results map[string]map[string]error
Results map[string]map[string][]error
}

func (r Report) IsPassing() bool {
for _, err := range r.Results {
if err != nil {
for _, errs := range r.Results {
if len(errs) > 0 {
return false
}
}
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module github.com/TBD54566975/web5-spec

go 1.20

require golang.org/x/exp v0.0.0-20230905200255-921286631fa9
require (
github.com/mr-tron/base58 v1.2.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
192 changes: 192 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,30 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/DIDIonCreateResponse"
/did-ion/update:
post:
operationId: did_ion_update
/did-ion/recover:
post:
operationId: did_ion_recover
/did-ion/deactivate:
post:
operationId: did_ion_deactivate
/did-ion/resolve:
post:
operationId: did_ion_resolve
/did-ion/anchor:
post:
operationId: did_ion_anchor
/did-key/create:
post:
operationId: did_key_create
/did-key/resolve:
post:
operationId: did_key_resolve
/credentials/presentation-exchange:
post:
operationId: credential_presentation_exchange
/credentials/issue:
post:
operationId: credential_issue
Expand All @@ -28,6 +52,167 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/CredentialIssuanceResponse"
/crypto/generate-key/secp256k1:
post:
operationId: crypto_generate_key_secp256k1
/crypto/generate-key/ed25519:
post:
operationId: crypto_generate_key_ed25519
/crypto/generate-key/secp256r1:
post:
operationId: crypto_generate_key_secp256r1
/crypto/verify/secp256k1:
post:
operationId: crypto_verify_secp256k1
/crypto/verify/ed25519:
post:
operationId: crypto_verify_ed25519
/crypto/verify/secp256r1:
post:
operationId: crypto_verify_secp256r1
/crypto/jose/jws-create:
post:
operationId: crypto_jose_jws_create
/crypto/jose/jws-verify:
post:
operationId: crypto_jose_jws_verify
/crypto/jose/jwk-encode:
post:
operationId: crypto_jose_jwk_encode
/crypto/jose/jwk-decode:
post:
operationId: crypto_jose_jwk_decode
/crypto/jose/jwt-create:
post:
operationId: crypto_jose_jwt_create
/crypto/jose/jwt-verify:
post:
operationId: crypto_jose_jwt_verify
/crypto/key-manager/generate-key:
post:
operationId: crypto_key_manager_generate_key
/crypto/key-manager/import-key:
post:
operationId: crypto_key_manager_import_key
/crypto/key-manager/sign:
post:
operationId: crypto_key_manager_sign
/crypto/key-manager/verify:
post:
operationId: crypto_key_manager_verify
/encoders/base64/encode:
post:
operationId: encoders_base64_encode
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
/encoders/base64/decode:
post:
operationId: encoders_base64_decode
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
/encoders/base58/encode:
post:
operationId: encoders_base58_encode
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
/encoders/base58/decode:
post:
operationId: encoders_base58_decode
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
/encoders/sha256/encode:
post:
operationId: encoders_sha256_encode
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
/encoders/cbor/encode:
post:
operationId: encoders_cbor_encode
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
/encoders/cbor/decode:
post:
operationId: encoders_cbor_decode
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"
required: true
responses:
"200":
description: Successful operation
content:
application/json:
schema:
$ref: "#/components/schemas/EncodingDecodeRequestResponse"

/ready:
get:
operationId: server_ready
Expand Down Expand Up @@ -214,3 +399,10 @@ components:
properties:
did:
type: string
EncodingDecodeRequestResponse:
type: object
required:
- data
properties:
data:
type: string
Loading

0 comments on commit 32db7e7

Please sign in to comment.