Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
36bf177
It builds!
Mar 5, 2021
5f966f5
Merge remote-tracking branch 'upstream/main' into member_id_hash_cert
Mar 5, 2021
134f44d
Re-add padding
Mar 5, 2021
62dbf68
e2e test works
Mar 5, 2021
ac18697
Most things works!
Mar 5, 2021
e12525f
End-to-end tests work
Mar 7, 2021
456337a
frontend unit test
Mar 7, 2021
5313ef1
Member voting unit test fix
Mar 8, 2021
dd49be2
Entity ID class
Mar 8, 2021
36081aa
Refactor
Mar 8, 2021
6963785
Cleanup
Mar 8, 2021
dc0cf71
Cleanup
Mar 8, 2021
8763173
Changelog
Mar 8, 2021
f15c772
Fix format string
Mar 8, 2021
59a705a
Merge remote-tracking branch 'upstream/main' into member_id_hash_cert
Mar 8, 2021
6f6717c
Fix perf client with signatures
Mar 8, 2021
77e7de3
Remove user and member reverse lookup tables
Mar 9, 2021
f17a4da
Added doc
Mar 9, 2021
99eb945
Update src/node/entity_id.h
jumaffre Mar 9, 2021
61268b8
Merge node id and entity id
Mar 9, 2021
968f9b6
Merge branch 'member_id_hash_cert' of github.com:jumaffre/CCF into me…
Mar 9, 2021
cfeca4e
WIP
Mar 9, 2021
5ba7b51
Fix failing tests
Mar 9, 2021
19c47e0
Padding in start_network.py
Mar 9, 2021
9616008
Entity local id is string
Mar 9, 2021
4256f6e
Merge branch 'main' into member_id_hash_cert
jumaffre Mar 9, 2021
f548c7c
Update doc/governance/adding_member.rst
jumaffre Mar 9, 2021
2f1708b
value()
Mar 9, 2021
9625d28
Merge branch 'member_id_hash_cert' of github.com:jumaffre/CCF into me…
Mar 9, 2021
a1d2640
Changelog removed
Mar 9, 2021
489f535
fmt
Mar 9, 2021
bd16ad8
Merge remote-tracking branch 'upstream/main' into member_id_hash_cert
Mar 9, 2021
1f2fa7c
Update doc/governance/adding_member.rst
jumaffre Mar 9, 2021
586624f
More PR comments
Mar 9, 2021
17de15a
Merge branch 'member_id_hash_cert' of github.com:jumaffre/CCF into me…
Mar 9, 2021
ab99f0d
Merge branch 'main' into member_id_hash_cert
jumaffre Mar 10, 2021
b14c56d
Update schema
Mar 10, 2021
594fbb9
Merge branch 'member_id_hash_cert' of github.com:jumaffre/CCF into me…
Mar 10, 2021
06a09dc
Merge branch 'main' into member_id_hash_cert
jumaffre Mar 10, 2021
bdf5369
Explicit trimming and remove operator
Mar 10, 2021
386bed2
Merge branch 'member_id_hash_cert' of github.com:jumaffre/CCF into me…
Mar 10, 2021
111fed2
Merge branch 'main' into member_id_hash_cert
achamayou Mar 10, 2021
2fcd667
Comment
Mar 10, 2021
3022997
Merge branch 'member_id_hash_cert' of github.com:jumaffre/CCF into me…
Mar 10, 2021
ecbf91f
Merge branch 'main' into member_id_hash_cert
jumaffre Mar 10, 2021
c78246a
Merge branch 'main' into member_id_hash_cert
eddyashton Mar 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed

- `x-ccf-tx-view` and `x-ccf-tx-seqno` response headers have been removed, and replaced with `x-ms-ccf-transaction-id`. This includes both original fields, separated by a single `.`. Historical queries using `ccf::historical::adapter` should also pass a single combined `x-ms-ccf-transaction-id` header (#2257).
- Node unique identifier is the hex-encoded string of the SHA-256 digest of the node's identity public key, which is also used as the node's quote report data (#2241).
- Node unique identifier is the hex-encoded string of the SHA-256 digest of the node's DER-encoded identity public key, which is also used as the node's quote report data (#2241).
- Members and users unique identifier is the hex-encoded string of the SHA-256 digest of their DER-encoded identity certificate (i.e. fingerprint), which has to be specified as the `keyId` field for signed HTTP requests (#2279).
- The receipt interface has changed, `/app/receipt?commit=23` is replaced by `/app/receipt?transaction_id=2.23`. Receipt fetching is now implemented as a historical query, which means that the first reponse(s) may be 202 with a Retry-After header. Receipts are now structured JSON, as opposed to a flat byte sequence, and `/app/receipt/verify` has been removed in favour of an [offline verification sample](https://microsoft.github.io/CCF/ccf-0.19.0/use_apps/verify_tx.html#transaction-receipts).
- `ccfapp::get_rpc_handler()` now takes a reference to a `ccf::AbstractNodeContext` rather than `ccf::AbstractNodeState`. The node state can be obtained from the context via `get_node_state()`.

### Removed

- `get_receipt_for_seqno_v1` has been removed. Handlers wanting to return receipts must now use the historical API, and can obtain a receipt via `ccf::historical::StatePtr`. See the [historical query with receipt sample](https://microsoft.github.io/CCF/ccf-0.19.0/build_apps/logging_cpp.html#receipts) for reference.
- `caller_id` endpoint. Members and users can now compute their unique identifier without interacting with CCF (#2279).
- `public:ccf.internal.members.certs_der`, `public:ccf.internal.users.certs_der`, `public:ccf.internal.members.digests` and `public:ccf.internal.users.digests` KV tables (#2279).

## [0.18.5]

Expand Down
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ if(BUILD_TESTS)
http_parser.host sss.host
)

set_tests_properties(
member_voting_test
PROPERTIES ENVIRONMENT
RUNTIME_CONFIG_DIR=${CMAKE_SOURCE_DIR}/src/runtime_config
)

add_unit_test(
proposal_id_test
${CMAKE_CURRENT_SOURCE_DIR}/src/node/rpc/test/proposal_id_test.cpp
Expand All @@ -406,14 +412,6 @@ if(BUILD_TESTS)
http_parser.host sss.host
)

if(NOT ENV{RUNTIME_CONFIG_DIR})
set_tests_properties(
member_voting_test
PROPERTIES ENVIRONMENT
RUNTIME_CONFIG_DIR=${CMAKE_SOURCE_DIR}/src/runtime_config
)
endif()

add_unit_test(
lua_test ${CMAKE_CURRENT_SOURCE_DIR}/src/lua_interp/test/lua_test.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/lua_interp/test/lua_kv.cpp
Expand Down
9 changes: 8 additions & 1 deletion doc/governance/adding_member.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ Members that are registered in CCF `with` a public encryption key are recovery m

The member’s identity and encryption private keys (e.g. ``member_name_privk.pem`` and ``member_name_enc_privk.pem``) should be stored on a trusted device (e.g. HSM) while the certificate (e.g. ``member_name_cert.pem``) and public encryption key (e.g. ``member_name_enc_pubk.pem``) should be registered in CCF by members.

The CCF unique member identity is the hex-encoded string of the SHA-256 hash of the DER-encoded certificate, and can be computed from the certificate alone, without interacting with CCF:

.. code-block:: bash

$ identity_cert_path=/path/to/member/cert
$ openssl x509 -in "$identity_cert_path" -noout -fingerprint -sha256 | cut -d "=" -f 2 | sed 's/://g' | awk '{print tolower($0)}'

.. note:: See :ref:`overview/cryptography:Algorithms and Curves` for the list of supported cryptographic curves for member identity.

Registering a New Member
Expand Down Expand Up @@ -63,4 +70,4 @@ Then, the new member should sign the state digest returned by the ``/gov/ack/upd

Once the command completes, the new member becomes active and can take part in governance operations (e.g. creating a new proposal or voting for an existing one).

.. note:: The newly-activated member is also given a recovery share that can be used :ref:`to recover a defunct service <governance/accept_recovery:Submitting Recovery Shares>`.
.. note:: The newly-activated member is also given a recovery share that can be used :ref:`to recover a defunct service <governance/accept_recovery:Submitting Recovery Shares>`.
55 changes: 5 additions & 50 deletions doc/schemas/app_openapi.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
{
"components": {
"schemas": {
"CallerInfo": {
"properties": {
"caller_id": {
"$ref": "#/components/schemas/uint64"
}
},
"required": [
"caller_id"
],
"type": "object"
},
"CodeStatus": {
"enum": [
"ALLOWED_TO_JOIN"
Expand Down Expand Up @@ -66,6 +55,10 @@
],
"type": "object"
},
"EntityId": {
"pattern": "^[a-f0-9]{64}$",
"type": "string"
},
"GetCode__Out": {
"properties": {
"versions": {
Expand Down Expand Up @@ -136,7 +129,7 @@
"$ref": "#/components/schemas/string"
},
"node_id": {
"$ref": "#/components/schemas/NodeId"
"$ref": "#/components/schemas/EntityId"
},
"proof": {
"$ref": "#/components/schemas/GetReceipt__Element_array"
Expand Down Expand Up @@ -283,10 +276,6 @@
],
"type": "object"
},
"NodeId": {
"pattern": "^[a-f0-9]{64}$",
"type": "string"
},
"Report": {
"properties": {
"histogram": {
Expand Down Expand Up @@ -391,40 +380,6 @@
}
}
},
"/caller_id": {
"get": {
"parameters": [
{
"in": "query",
"name": "cert",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CallerInfo"
}
}
},
"description": "Default response description"
}
},
"security": [
{
"user_signature": []
},
{
"member_signature": []
}
]
}
},
"/code": {
"get": {
"responses": {
Expand Down
102 changes: 26 additions & 76 deletions doc/schemas/gov_openapi.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
{
"components": {
"schemas": {
"CallerInfo": {
"properties": {
"caller_id": {
"$ref": "#/components/schemas/uint64"
}
},
"required": [
"caller_id"
],
"type": "object"
},
"CodeStatus": {
"enum": [
"ALLOWED_TO_JOIN"
Expand Down Expand Up @@ -66,6 +55,28 @@
],
"type": "object"
},
"EntityId": {
"pattern": "^[a-f0-9]{64}$",
"type": "string"
},
"EntityId_to_Script": {
"items": {
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/EntityId"
},
{
"$ref": "#/components/schemas/Script"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"type": "array"
},
Comment thread
jumaffre marked this conversation as resolved.
"GetCode__Out": {
"properties": {
"versions": {
Expand Down Expand Up @@ -136,7 +147,7 @@
"$ref": "#/components/schemas/string"
},
"node_id": {
"$ref": "#/components/schemas/NodeId"
"$ref": "#/components/schemas/EntityId"
},
"proof": {
"$ref": "#/components/schemas/GetReceipt__Element_array"
Expand Down Expand Up @@ -202,17 +213,13 @@
],
"type": "object"
},
"NodeId": {
"pattern": "^[a-f0-9]{64}$",
"type": "string"
},
"Proposal": {
"properties": {
"parameter": {
"$ref": "#/components/schemas/json"
},
"proposer": {
"$ref": "#/components/schemas/uint64"
"$ref": "#/components/schemas/EntityId"
},
"script": {
"$ref": "#/components/schemas/Script"
Expand All @@ -221,7 +228,7 @@
"$ref": "#/components/schemas/ProposalState"
},
"votes": {
"$ref": "#/components/schemas/uint64_to_Script"
"$ref": "#/components/schemas/EntityId_to_Script"
}
},
"required": [
Expand All @@ -239,7 +246,7 @@
"$ref": "#/components/schemas/string"
},
"proposer_id": {
"$ref": "#/components/schemas/uint64"
"$ref": "#/components/schemas/EntityId"
},
"state": {
"$ref": "#/components/schemas/ProposalState"
Expand Down Expand Up @@ -354,24 +361,6 @@
"minimum": 0,
"type": "integer"
},
"uint64_to_Script": {
"items": {
"items": {
"oneOf": [
{
"$ref": "#/components/schemas/uint64"
},
{
"$ref": "#/components/schemas/Script"
}
]
},
"maxItems": 2,
"minItems": 2,
"type": "array"
},
"type": "array"
},
"uint8": {
"maximum": 255,
"minimum": 0,
Expand All @@ -389,11 +378,6 @@
"description": "Request must be signed according to the HTTP Signature scheme. The signer must be a member identity registered with this service.",
"scheme": "signature",
"type": "http"
},
"user_signature": {
"description": "Request must be signed according to the HTTP Signature scheme. The signer must be a user identity registered with this service.",
"scheme": "signature",
"type": "http"
}
}
},
Expand Down Expand Up @@ -481,40 +465,6 @@
}
}
},
"/caller_id": {
"get": {
"parameters": [
{
"in": "query",
"name": "cert",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CallerInfo"
}
}
},
"description": "Default response description"
}
},
"security": [
{
"user_signature": []
},
{
"member_signature": []
}
]
}
},
"/code": {
"get": {
"responses": {
Expand Down
Loading