This repository was archived by the owner on Apr 6, 2026. It is now read-only.
CERT-22 - Add CSR feature#53
Merged
Merged
Conversation
Contributor
|
@nyagamunene What's the status with this one? |
Contributor
Author
There is still some issues with tests which am currently addressing. |
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
dborovcanin
suggested changes
Nov 28, 2024
| } | ||
| } | ||
|
|
||
| func retrieveCSREndpoint(svc certs.Service) endpoint.Endpoint { |
Contributor
There was a problem hiding this comment.
Switch the order of retrieve and list endpoints.
| EncodeResponse, | ||
| opts..., | ||
| ), "").ServeHTTP) | ||
| r.Get("/list", otelhttp.NewHandler(kithttp.NewServer( |
Contributor
There was a problem hiding this comment.
There's no need for /list, an empty route will work.
| encodeCADownloadResponse, | ||
| opts..., | ||
| ), "download_ca").ServeHTTP) | ||
| r.Route("/csr", func(r chi.Router) { |
|
|
||
| func (mm *metricsMiddleware) SignCSR(ctx context.Context, csrID string, approve bool) error { | ||
| defer func(begin time.Time) { | ||
| mm.counter.With("method", "process_csr").Add(1) |
Contributor
There was a problem hiding this comment.
mm.counter.With("method", "sign_csr").Add(1)| func (mm *metricsMiddleware) SignCSR(ctx context.Context, csrID string, approve bool) error { | ||
| defer func(begin time.Time) { | ||
| mm.counter.With("method", "process_csr").Add(1) | ||
| mm.latency.With("method", "process_csr").Observe(time.Since(begin).Seconds()) |
Comment on lines
+243
to
+247
| // ListCSRs returns a list of CSRs based on filter criteria | ||
| ListCSRs(ctx context.Context, pm PageMetadata) (CSRPage, error) | ||
|
|
||
| // RetrieveCSR retrieves a specific CSR by ID | ||
| RetrieveCSR(ctx context.Context, csrID string) (CSR, error) |
| { | ||
| Id: "csr_1", | ||
| Up: []string{ | ||
| `CREATE TABLE IF NOT EXISTS csr ( |
Contributor
There was a problem hiding this comment.
Double-check if this is aligned properly.
Comment on lines
+294
to
+304
| // ListCSRs returns a list of CSRs based on filter criteria | ||
| // | ||
| // response, _ := sdk.ListCSRs(sdk.PageMetadata{EntityID: "entity_id", Status: "pending"}) | ||
| // fmt.Println(response) | ||
| ListCSRs(pm PageMetadata) (CSRPage, errors.SDKError) | ||
|
|
||
| // RetrieveCSR retrieves a specific CSR by ID | ||
| // | ||
| // response, _ := sdk.RetrieveCSR("csr_id") | ||
| // fmt.Println(response) | ||
| RetrieveCSR(csrID string) (CSR, errors.SDKError) |
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
dborovcanin
approved these changes
Nov 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What does this do?
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Yes.
Did you document any new/modified features?
Yes
Notes