Skip to content

Commit 0cd2467

Browse files
authored
Merge pull request #66 from hug-dev/full-review
Update the books
2 parents 2e090a4 + e426a59 commit 0cd2467

35 files changed

+402
-639
lines changed

src/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ provide a common API to secure services in a platform-agnostic way.
55

66
Find here all the technical documentation of Parsec, alongside user and developer guides.
77

8+
Go straight to the [overview](overview.md) to learn more about the project! Then, depending on what
9+
you want to know, you can go to the [users](parsec_users.md), [client
10+
developers](parsec_client/README.md), [service developers](parsec_service/README.md) or
11+
[security](parsec_security/README.md) sections.
12+
813
# Disclaimer
914

1015
Parsec is a new open source project and is under development. This code repository is being made

src/SUMMARY.md

+27-30
Original file line numberDiff line numberDiff line change
@@ -2,63 +2,60 @@
22

33
- [Introduction](README.md)
44
- [Overview](overview.md)
5-
- [Service API coverage](service_api_coverage.md)
6-
- [Clients API coverage](clients_api_coverage.md)
7-
- [Parsec Threat Model](threat_model/threat_model.md)
8-
- [Recommendations for Secure Deployment](threat_model/secure_deployment.md)
9-
- [Parsec Rust Client Threat Model](threat_model/rust_client_threat_model.md)
105
- [Parsec for users](parsec_users.md)
116
- [Parsec for client developers](parsec_client/README.md)
7+
- [API Overview](parsec_client/api_overview.md)
8+
- [Wire Protocol](parsec_client/wire_protocol.md)
9+
- [Status Codes](parsec_client/status_codes.md)
10+
- [Writing a new Parsec Client Library](parsec_client/writing_library.md)
1211
- [Operations](parsec_client/operations/README.md)
13-
- [AddClient](parsec_client/operations/add_client.md)
14-
- [ListOpcodes](parsec_client/operations/list_opcodes.md)
15-
- [ListProviders](parsec_client/operations/list_providers.md)
16-
- [ListAuthenticators](parsec_client/operations/list_authenticators.md)
17-
- [Ping](parsec_client/operations/ping.md)
18-
- [ProveClient](parsec_client/operations/prove_client.md)
19-
- [PsaDestroyKey](parsec_client/operations/psa_destroy_key.md)
20-
- [PsaExportPublicKey](parsec_client/operations/psa_export_public_key.md)
21-
- [PsaExportKey](parsec_client/operations/psa_export_key.md)
22-
- [PsaGenerateKey](parsec_client/operations/psa_generate_key.md)
23-
- [PsaImportKey](parsec_client/operations/psa_import_key.md)
24-
- [PsaRawKeyAgreement](parsec_client/operations/psa_raw_key_agreement.md)
12+
- [Parsec Operations Coverage](parsec_client/operations/service_api_coverage.md)
2513
- [PSA Key Attributes](parsec_client/operations/psa_key_attributes.md)
2614
- [PSA Algorithm](parsec_client/operations/psa_algorithm.md)
27-
- [PsaSignMessage](parsec_client/operations/psa_sign_message.md)
28-
- [PsaVerifyMessage](parsec_client/operations/psa_verify_message.md)
15+
- [Ping](parsec_client/operations/ping.md)
16+
- [PsaGenerateKey](parsec_client/operations/psa_generate_key.md)
17+
- [PsaDestroyKey](parsec_client/operations/psa_destroy_key.md)
2918
- [PsaSignHash](parsec_client/operations/psa_sign_hash.md)
3019
- [PsaVerifyHash](parsec_client/operations/psa_verify_hash.md)
31-
- [PsaHashCompute](parsec_client/operations/psa_hash_compute.md)
32-
- [PsaHashCompare](parsec_client/operations/psa_hash_compare.md)
20+
- [PsaImportKey](parsec_client/operations/psa_import_key.md)
21+
- [PsaExportPublicKey](parsec_client/operations/psa_export_public_key.md)
22+
- [ListProviders](parsec_client/operations/list_providers.md)
23+
- [ListOpcodes](parsec_client/operations/list_opcodes.md)
3324
- [PsaAsymmetricEncrypt](parsec_client/operations/psa_asymmetric_encrypt.md)
3425
- [PsaAsymmetricDecrypt](parsec_client/operations/psa_asymmetric_decrypt.md)
26+
- [PsaExportKey](parsec_client/operations/psa_export_key.md)
27+
- [PsaGenerateRandom](parsec_client/operations/psa_generate_random.md)
28+
- [ListAuthenticators](parsec_client/operations/list_authenticators.md)
29+
- [PsaHashCompute](parsec_client/operations/psa_hash_compute.md)
30+
- [PsaHashCompare](parsec_client/operations/psa_hash_compare.md)
3531
- [PsaAeadEncrypt](parsec_client/operations/psa_aead_encrypt.md)
3632
- [PsaAeadDecrypt](parsec_client/operations/psa_aead_decrypt.md)
33+
- [PsaRawKeyAgreement](parsec_client/operations/psa_raw_key_agreement.md)
3734
- [PsaCipherEncrypt](parsec_client/operations/psa_cipher_encrypt.md)
3835
- [PsaCipherDecrypt](parsec_client/operations/psa_cipher_decrypt.md)
3936
- [PsaMacCompute](parsec_client/operations/psa_mac_compute.md)
4037
- [PsaMacVerify](parsec_client/operations/psa_mac_verify.md)
41-
- [ShareTrustBundle](parsec_client/operations/share_trust_bundle.md)
42-
- [PsaGenerateRandom](parsec_client/operations/psa_generate_random.md)
43-
- [API Overview](parsec_client/api_overview.md)
44-
- [Status Codes](parsec_client/status_codes.md)
45-
- [Wire Protocol](parsec_client/wire_protocol.md)
46-
- [Writing a new Parsec Client Library](parsec_client/writing_library.md)
38+
- [PsaSignMessage](parsec_client/operations/psa_sign_message.md)
39+
- [PsaVerifyMessage](parsec_client/operations/psa_verify_message.md)
4740
- [Parsec for service developers](parsec_service/README.md)
4841
- [System Architecture](parsec_service/system_architecture.md)
4942
- [Interfaces and Dataflow](parsec_service/interfaces_and_dataflow.md)
5043
- [Source Code Structure](parsec_service/source_code_structure.md)
51-
- [Providers](parsec_service/providers.md)
52-
- [Converters](parsec_service/converters.md)
53-
- [Authenticators](parsec_service/authenticators.md)
5444
- [Listeners](parsec_service/listeners.md)
45+
- [Authenticators](parsec_service/authenticators.md)
46+
- [Converters](parsec_service/converters.md)
47+
- [Providers](parsec_service/providers.md)
5548
- [Key Info Managers](parsec_service/key_info_managers.md)
5649
- [Adding a new Parsec Provider](parsec_service/adding_provider.md)
5750
- [How to build and run Parsec](parsec_service/build_run.md)
5851
- [How to securely install Parsec on Linux](parsec_service/install_parsec_linux.md)
5952
- [Parsec Configuration](parsec_service/configuration.md)
6053
- [How to test Parsec](parsec_service/tests/README.md)
6154
- [List of existing tests](parsec_service/tests/existing_tests.md)
55+
- [Parsec Security](parsec_security/README.md)
56+
- [Parsec Threat Model](parsec_security/parsec_threat_model/threat_model.md)
57+
- [Recommendations for Secure Deployment](parsec_security/secure_deployment.md)
58+
- [Parsec Rust Client Threat Model](parsec_security/rust_client_threat_model/threat_model.md)
6259
- [Contributing](contributing/README.md)
6360
- [How to add operations to Parsec](contributing/adding_new_operation_how_to.md)
6461

src/clients_api_coverage.md

-125
This file was deleted.

src/contributing/adding_new_operation_how_to.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Create the specification page for the Parsec Book, under
1515
also be found in the menu on the left of all pages). Include operation details such as parameters,
1616
results, errors specific to the operation, a description, and a link to the
1717
[protobuf](#parsec-operations) contract (which will be created further on). Also update all API
18-
tables on the [Service API](../service_api_coverage.md) and [Client API](../clients_api_coverage.md)
19-
pages to reflect the new addition (create any API tables if they are missing).
18+
tables on the [Parsec Operations Coverage](../parsec_client/operations/service_api_coverage.md) page
19+
to reflect the new addition (create any API tables if they are missing).
2020

2121
The opcode used should be the next available one. To find this, go to
2222
[`parsec-interface-rs/src/requests/mod.rs`](https://github.com/parallaxsecond/parsec-interface-rs/blob/master/src/operations/mod.rs)

src/parsec_client/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
This section offers the information needed for building Parsec client libraries. The topics covered
44
are:
55

6-
- [Operations](operations) - structured description of all Parsec operations; this subsection
7-
provides the official documentation for the API
86
- [API overview](api_overview.md) - overview of the API and the design principles behind it
9-
- [Status codes](status_codes.md) - comprehensive list of response codes returned by the service and
10-
their meaning
117
- [Wire protocol](wire_protocol.md) - detailed description of the representation and meaning of data
128
communicated between the client and service
9+
- [Status codes](status_codes.md) - comprehensive list of response codes returned by the service and
10+
their meaning
1311
- [Writing a new client library](writing_library.md) - hints and tips for getting started with
1412
developing a new client library
13+
- [Operations](operations) - structured description of all Parsec operations; this subsection
14+
provides the official documentation for the API
1515

1616
*Copyright 2019 Contributors to the Parsec project.*

src/parsec_client/api_overview.md

+20-23
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ configuration that is applied at service-deployment time.
5959
While the service can be composed from multiple providers, any given API operation needs to be
6060
implemented by a single provider. This means that client code needs to specify the target provider
6161
when it makes an operation request. To achieve this, the service assigns an 8-bit integer value
62-
(from 0 to 255) to each available provider. In practice, the numer of providers would be very small:
63-
probably just two or three. This integer value is the **provider identifier**. Client code must set
64-
a single provider identifier in each API request. The [**wire protocol
62+
(from 0 to 255) to each available provider. In practice, the number of providers would be very
63+
small: probably just two or three. This integer value is the **provider identifier**. Client code
64+
must set a single provider identifier in each API request. The [**wire protocol
6565
specification**](wire_protocol.md) explains how a request header field is used to route the request
6666
to the correct provider.
6767

6868
In order to set a provider identifier in an API request, the client must first be able to determine
6969
what providers are available, what their identifiers are, and what their characteristics are (such
7070
as whether they are hardware-backed or software-backed). This is done by first referencing the
7171
**core provider**. The core provider is the only provider that is guaranteed to be available in any
72-
deployment of the service. It has a provider identifier of zero (the only reserved value for
72+
deployment of the service. It has a provider identifier of zero (`0x00`, the only reserved value for
7373
provider identifiers). The core provider is special in that it doesn't implement any security or
7474
cryptographic operations. The core provider is used to represent the service as a whole. The
7575
operations of the core provider can be used to gather information about the health and configuration
@@ -182,10 +182,12 @@ permitted numerical values for this field are given as follows:-
182182
it indicates improper coding or a possible defect on the client side). See the section below on
183183
unauthenticated operations.
184184
- A value of 1 (`0x01`) indicates direct authentication. The service will expect the
185-
**authentication** field to contain a cleartext copy of the application identity.
186-
- A value of 2 (`0x02`) indicates authentication tokens. The service will expect the
187-
**authentication** field to contain a JWT token. Tokens must be signed with the private key of
188-
the identity provider and their validity period must cover the moment when the check is done.
185+
**authentication** field to contain a cleartext copy of the application identity, encoded as a
186+
UTF-8 string.
187+
- A value of 2 (`0x02`) indicates authentication tokens. This authentication type is not currently
188+
supported. The service will expect the **authentication** field to contain a JWT token. Tokens
189+
must be signed with the private key of the identity provider and their validity period must cover
190+
the moment when the check is done.
189191
- A value of 3 (`0x03`) indicates Unix peer credentials authentication. The service expects the
190192
**authentication** field to contain the Unix user identifier (UID, **not** username) of the
191193
connecting process as a zero-padded little-endian 32-bit unsigned integer. The Parsec service
@@ -207,7 +209,7 @@ set to 0 (`0x00`).
207209

208210
As per the [**wire protocol specification**](wire_protocol.md), API request headers contain fields
209211
for **content type** and **accept type**, which respectively indicate how the request body and
210-
response body are encoded. Currently, the only supported value for these fields is 1 (`0x01`),
212+
response body are encoded. Currently, the only supported value for these fields is one (`0x01`),
211213
meaning that all request and response bodies contain serialized protobuf messages. All other values
212214
are unsupported and will be rejected by the service.
213215

@@ -232,20 +234,15 @@ While this API is closely aligned with the PSA Crypto API, there are some differ
232234
difference is in the conventions used to name and reference cryptographic keys.
233235

234236
In the PSA Crypto API, every key has a 32-bit numerical identifier. This identifier is set by the
235-
caller when the key is created. Client code then uses this 32-bit identifier to **open** the key. A
236-
key must be opened before it can be used in any cryptographic operations. An open key is referenced
237-
using a **handle** (which is distinct from the identifier). The handle is the only way that the
238-
client code can involve the key in cryptographic functions. Once the client has finished using the
239-
key, it **closes** the handle.
240-
241-
This API differs in two ways. Firstly, the key names are not 32-bit numerical values: they are
242-
**strings**. Secondly, there is no notion of key handles. Keys are always referenced by name. There
243-
is no operation to open or close a key. Cryptographic operations are all specified in terms of the
244-
key name string. However, while the notion of a key handle is absent, it is important to understand
245-
that the opacity of keys - one of the critical design characteristics of the PSA Crypto API - is
246-
preserved here. Key names are used to reference keys for cryptographic operations, but the actual
247-
key material is *never* exposed to the caller of the API unless an explicit operation is invoked to
248-
export the key (and the key's usage policy permits for such an export to occur).
237+
caller when the persistent key is created. Client code then uses this 32-bit identifier to refer to
238+
the key for use in any cryptographic operation.
239+
240+
This API is different: the key names are not 32-bit numerical values, they are **UTF-8 strings**.
241+
Cryptographic operations are all specified in terms of the key name string. It is important to
242+
understand that the opacity of keys - one of the critical design characteristics of the PSA Crypto
243+
API - is preserved here. Key names are used to reference keys for cryptographic operations, but the
244+
actual key material is *never* exposed to the caller of the API unless an explicit operation is
245+
invoked to export the key (and the key's usage policy permits for such an export to occur).
249246

250247
The use of string names offers greater flexibility in how names can be chosen and structured. It
251248
allows for names to be readable and meaningful. It also allows for names to follow a structured

0 commit comments

Comments
 (0)