Skip to content

Feature gRPC#47

Merged
tab merged 20 commits into
masterfrom
feature/grpc
May 4, 2025
Merged

Feature gRPC#47
tab merged 20 commits into
masterfrom
feature/grpc

Conversation

@tab
Copy link
Copy Markdown
Owner

@tab tab commented Apr 4, 2025

  • Use proto as submodule
  • Add gRPC authentication interceptor
  • Add gRPC permission service
  • Add gRPC scope service
  • Add gRPC role service
  • Add gRPC token service
  • Add gRPC user service
  • Use RSA keys for JWT signing
  • Add integration testing framework and workflow
  • Update README and docs

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 87.99232% with 125 lines in your changes missing coverage. Please review.

Project coverage is 82.13%. Comparing base (3adc4bc) to head (b11f31f).

Files with missing lines Patch % Lines
internal/app/rpcs/services/roles.go 83.75% 21 Missing and 5 partials ⚠️
internal/app/rpcs/services/users.go 85.31% 21 Missing and 5 partials ⚠️
internal/config/server/grpc.go 74.02% 15 Missing and 5 partials ⚠️
internal/app/app.go 0.00% 19 Missing ⚠️
internal/app/rpcs/services/permissions.go 91.24% 9 Missing and 3 partials ⚠️
internal/app/rpcs/services/scopes.go 91.24% 9 Missing and 3 partials ⚠️
internal/app/rpcs/services/tokens.go 93.33% 3 Missing and 1 partial ⚠️
internal/config/middlewares/logger.go 92.10% 2 Missing and 1 partial ⚠️
internal/app/services/roles.go 81.81% 2 Missing ⚠️
internal/config/middlewares/telemetry.go 85.71% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   81.51%   82.13%   +0.62%     
==========================================
  Files          57       63       +6     
  Lines        2732     3230     +498     
==========================================
+ Hits         2227     2653     +426     
- Misses        425      478      +53     
- Partials       80       99      +19     
Files with missing lines Coverage Δ
internal/app/rpcs/interceptors/authentication.go 100.00% <100.00%> (ø)
internal/app/rpcs/interceptors/logger.go 100.00% <100.00%> (ø)
internal/app/rpcs/interceptors/trace.go 100.00% <100.00%> (ø)
internal/app/rpcs/registry.go 100.00% <100.00%> (ø)
internal/app/services/authentication.go 100.00% <ø> (ø)
internal/app/services/authentication/mobileid.go 100.00% <ø> (ø)
internal/app/services/authentication/smartid.go 100.00% <ø> (ø)
internal/app/services/permissions.go 100.00% <100.00%> (+6.97%) ⬆️
internal/app/services/scopes.go 100.00% <100.00%> (+34.88%) ⬆️
internal/app/services/sessions.go 81.81% <ø> (ø)
... and 24 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread .github/actions/integration/Makefile Outdated
@@ -0,0 +1,145 @@
LOKI_REPO ?= $(shell pwd)/../../loki
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
LOKI_REPO ?= $(shell pwd)/../../loki
LOKI_HOME ?= ""
LOKI_REPO ?= ${LOKI_HOME}/loki

DB_HOST = localhost
DB_PORT = 5432

GOOSE_DRIVER = postgres
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
GOOSE_DRIVER = postgres
GOOSE_DRIVER ?= postgres

local uuid = require("uuid")

uuid.randomseed(os.time())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Please find more suitable package. Not .github

Comment thread .gitmodules
@@ -0,0 +1,3 @@
[submodule "proto"]
path = proto
url = git@github.com:tab/loki-proto.git
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  1. go_package
option go_package = "https://github.com/tab/loki/internal/app/rpcs/proto/sso/v1;ssov1";

Comment thread README.md Outdated
```sh
# Generate CA
openssl genrsa -out certs/ca.key 4096
openssl req -new -x509 -key certs/ca.key -sha256 -subj "/CN=Loki CA" -out certs/ca.pem -days 3650
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
openssl req -new -x509 -key certs/ca.key -sha256 -subj "/CN=Loki CA" -out certs/ca.pem -days 3650
openssl req -new -x509 -key certs/ca.key -sha256 -subj '/CN=Loki CA' -out certs/ca.pem -days 3650

}, nil
}

func (p *permissionsService) Update(ctx context.Context, req *proto.UpdatePermissionRequest) (*proto.UpdatePermissionResponse, error) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
func (p *permissionsService) Update(ctx context.Context, req *proto.UpdatePermissionRequest) (*proto.UpdatePermissionResponse, error) {
func (p *permissionsService) UpdatePermission(ctx context.Context, req *proto.UpdatePermissionRequest) (*proto.UpdatePermissionResponse, error) {

tab added 18 commits April 20, 2025 12:25
Added gRPC authentication interceptor
Added permission service with CRUD operations for managing user permissions
Added scope service with CRUD operations for managing application scopes
Added role service with CRUD operations for managing user roles
Added token service with List and Delete operations for managing user JSON web tokens
Added user service with CRUD operations for managing users
Added new error constants for failed record creation, updating, deletion, and not found errors
Updated the JWT implementation to use RSA keys instead of a single secret key for signing
Deleted the backoffice controllers and tests
REST API replaced with gRPC
Added sections for generating JWT signing keys and mTLS certificates
Added related repositories section
@tab tab merged commit 18e00e1 into master May 4, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants