Certs - Remove all magistrala dependencies#4
Conversation
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>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
arvindh123
left a comment
There was a problem hiding this comment.
@dborovcanin , How this certs will be working?
Like it will be replacing only vault or it will be replacing entire certs service in Magistrala?
| return "", err | ||
| } | ||
|
|
||
| func (s *service) IssueCert(ctx context.Context, userId, entityID string, entityType EntityType, ipAddrs []string) (string, error) { |
There was a problem hiding this comment.
it will be good, if we provide all the options Organization, Orgnaization Unit,CN, Subject Alternative Names, etc...
@dborovcanin
Please give your comments
There was a problem hiding this comment.
I agree all options should be available on issuing
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>
SammyOina
left a comment
There was a problem hiding this comment.
import common utilities from mg to avoid code duplication
| return &grpcServer{ | ||
| getEntity: kitgrpc.NewServer( | ||
| otelkit.EndpointMiddleware(otelkit.WithOperation("get_entity"))(getEntityEndpoint(svc)), | ||
| (getEntityEndpoint(svc)), |
There was a problem hiding this comment.
why have you removed tracing
| return &grpcServer{ | ||
| getEntity: kitgrpc.NewServer( | ||
| otelkit.EndpointMiddleware(otelkit.WithOperation("get_entity"))(getEntityEndpoint(svc)), | ||
| (getEntityEndpoint(svc)), |
There was a problem hiding this comment.
why have you removed tracing
| ports: | ||
| - ${AM_JAEGER_FRONTEND}:${AM_JAEGER_FRONTEND} | ||
| - ${AM_JAEGER_OLTP_HTTP_PORT}:${AM_JAEGER_OLTP_HTTP_PORT} | ||
|
No newline at end of file |
There was a problem hiding this comment.
a standalone serevice, root ca should be generated by the service itself during initialization
There was a problem hiding this comment.
can you import form mg to avoid repetition
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
| @@ -0,0 +1,47 @@ | |||
| // Copyright (c) Abstract Machines | |||
There was a problem hiding this comment.
Since this is a single service, we do not need apiutil package from monorepo, and probably there's no need for some of these errors. Remove this package and add errors that make sense to API layer (simple errors.go file will work).
| @@ -0,0 +1,123 @@ | |||
| // Copyright (c) Abstract Machines | |||
There was a problem hiding this comment.
Same, everything from pkg/apiutil belongs to api directly. Check if all of these methods are needed.
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
dborovcanin
left a comment
There was a problem hiding this comment.
Please fix the Dockerfile by removing web leftovers:
FROM golang:1.23-alpine AS builder
ARG SVC
ARG GOARCH
ARG GOARM
ARG VERSION
ARG COMMIT
ARG TIME
WORKDIR /go/src/github.com/absmach/certs
COPY . .
RUN apk update \
&& apk add make \
&& make $SVC \
&& mv build/$SVC /exe
FROM scratch
# Rrequired for billing service
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /exe /
ENTRYPOINT ["/exe"]Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
What type of PR is this?
This is a refactor because it changes the following functionality because it removes Magistrala dependencies to avoid cyclic imports.
What does this do?
It removes Magistrala dependencies and implements some of them in the repo.
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Yes.
Did you document any new/modified features?
No.
Notes