docs: improve comments in security proto

The existing comments did not match the service definition (they look
like copy paste from another service). I also added a little bit more
comments for the fields in the request and response.

Signed-off-by: Tomasz Zurkowski <zurkowski@google.com>
Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
Tomasz Zurkowski 2022-03-14 22:23:52 +01:00 committed by Andrey Smirnov
parent caf800fe84
commit cc7719c9d0
No known key found for this signature in database
GPG Key ID: 7B26396447AB6DFD
3 changed files with 16 additions and 10 deletions

View File

@ -9,13 +9,16 @@ service SecurityService {
rpc Certificate(CertificateRequest) returns (CertificateResponse); rpc Certificate(CertificateRequest) returns (CertificateResponse);
} }
// The request message containing the process name. // The request message containing the certificate signing request.
message CertificateRequest { message CertificateRequest {
// Certificate Signing Request in PEM format.
bytes csr = 1; bytes csr = 1;
} }
// The response message containing the requested logs. // The response message containing signed certificate.
message CertificateResponse { message CertificateResponse {
// Certificate of the CA that signed the requested certificate in PEM format.
bytes ca = 1; bytes ca = 1;
// Signed X.509 requested certificate in PEM format.
bytes crt = 2; bytes crt = 2;
} }

View File

@ -21,12 +21,13 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
) )
// The request message containing the process name. // The request message containing the certificate signing request.
type CertificateRequest struct { type CertificateRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
// Certificate Signing Request in PEM format.
Csr []byte `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"` Csr []byte `protobuf:"bytes,1,opt,name=csr,proto3" json:"csr,omitempty"`
} }
@ -69,13 +70,15 @@ func (x *CertificateRequest) GetCsr() []byte {
return nil return nil
} }
// The response message containing the requested logs. // The response message containing signed certificate.
type CertificateResponse struct { type CertificateResponse struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Ca []byte `protobuf:"bytes,1,opt,name=ca,proto3" json:"ca,omitempty"` // Certificate of the CA that signed the requested certificate in PEM format.
Ca []byte `protobuf:"bytes,1,opt,name=ca,proto3" json:"ca,omitempty"`
// Signed X.509 requested certificate in PEM format.
Crt []byte `protobuf:"bytes,2,opt,name=crt,proto3" json:"crt,omitempty"` Crt []byte `protobuf:"bytes,2,opt,name=crt,proto3" json:"crt,omitempty"`
} }

View File

@ -3067,12 +3067,12 @@ ResourceService provides user-facing API for the Talos resources.
<a name="securityapi.CertificateRequest"></a> <a name="securityapi.CertificateRequest"></a>
### CertificateRequest ### CertificateRequest
The request message containing the process name. The request message containing the certificate signing request.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| csr | [bytes](#bytes) | | | | csr | [bytes](#bytes) | | Certificate Signing Request in PEM format. |
@ -3082,13 +3082,13 @@ The request message containing the process name.
<a name="securityapi.CertificateResponse"></a> <a name="securityapi.CertificateResponse"></a>
### CertificateResponse ### CertificateResponse
The response message containing the requested logs. The response message containing signed certificate.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ca | [bytes](#bytes) | | | | ca | [bytes](#bytes) | | Certificate of the CA that signed the requested certificate in PEM format. |
| crt | [bytes](#bytes) | | | | crt | [bytes](#bytes) | | Signed X.509 requested certificate in PEM format. |