Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

AMCERTS-160 - Remove unused endpoints#159

Merged
dborovcanin merged 11 commits into
absmach:mainfrom
nyagamunene:update_api
Sep 11, 2025
Merged

AMCERTS-160 - Remove unused endpoints#159
dborovcanin merged 11 commits into
absmach:mainfrom
nyagamunene:update_api

Conversation

@nyagamunene

@nyagamunene nyagamunene commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

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?

Did you document any new/modified features?

Notes

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
@nyagamunene nyagamunene changed the title NOISSUE - Fix OCSP NOISSUE - Remove used endpoints Sep 10, 2025
@nyagamunene nyagamunene changed the title NOISSUE - Remove used endpoints NOISSUE - Remove unused endpoints Sep 10, 2025
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>
@nyagamunene nyagamunene marked this pull request as ready for review September 10, 2025 17:02
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Comment thread api/http/responses.go Outdated
Comment thread api/http/endpoint.go
Comment on lines -59 to -95
func requestCertDownloadTokenEndpoint(svc certs.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (response any, err error) {
req := request.(viewReq)
if err := req.validate(); err != nil {
return requestCertDownloadTokenRes{}, err
}

token, err := svc.RetrieveCertDownloadToken(ctx, req.id)
if err != nil {
return requestCertDownloadTokenRes{}, err
}

return requestCertDownloadTokenRes{Token: token}, nil
}
}

func downloadCertEndpoint(svc certs.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (response any, err error) {
req := request.(downloadReq)
if err := req.validate(); err != nil {
return fileDownloadRes{}, err
}
cert, ca, err := svc.RetrieveCert(ctx, req.token, req.id)
if err != nil {
return fileDownloadRes{}, err
}

return fileDownloadRes{
Certificate: cert.Certificate,
PrivateKey: cert.Key,
CA: ca,
Filename: "certificates.zip",
ContentType: "application/zip",
}, nil
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these removed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these removed

This is because openbao's keys are one-time, so the user has to download from issue certs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep a copy in repo

Comment thread api/http/endpoint.go
Comment on lines -59 to -95
func requestCertDownloadTokenEndpoint(svc certs.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (response any, err error) {
req := request.(viewReq)
if err := req.validate(); err != nil {
return requestCertDownloadTokenRes{}, err
}

token, err := svc.RetrieveCertDownloadToken(ctx, req.id)
if err != nil {
return requestCertDownloadTokenRes{}, err
}

return requestCertDownloadTokenRes{Token: token}, nil
}
}

func downloadCertEndpoint(svc certs.Service) endpoint.Endpoint {
return func(ctx context.Context, request any) (response any, err error) {
req := request.(downloadReq)
if err := req.validate(); err != nil {
return fileDownloadRes{}, err
}
cert, ca, err := svc.RetrieveCert(ctx, req.token, req.id)
if err != nil {
return fileDownloadRes{}, err
}

return fileDownloadRes{
Certificate: cert.Certificate,
PrivateKey: cert.Key,
CA: ca,
Filename: "certificates.zip",
ContentType: "application/zip",
}, nil
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are these removed

@arvindh123 arvindh123 changed the title NOISSUE - Remove unused endpoints AMCERTS-160 - Remove unused endpoints Sep 11, 2025
SammyOina
SammyOina previously approved these changes Sep 11, 2025

@WashingtonKK WashingtonKK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IssueCert on sdk should return the cert files.

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
@dborovcanin dborovcanin merged commit 007a46c into absmach:main Sep 11, 2025
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Remove unused endpoints

4 participants