Skip to content

Commit

Permalink
refactor: Substituted REST Mapper implementation by REST Handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
ralvarezdev committed Dec 5, 2024
1 parent 34dd14e commit b0ada31
Show file tree
Hide file tree
Showing 63 changed files with 341 additions and 601 deletions.
10 changes: 0 additions & 10 deletions config/rest/api/children.go

This file was deleted.

8 changes: 8 additions & 0 deletions config/rest/api/endpoints.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package api

import (
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Base is the base endpoint for the API REST endpoints
var Base = typesrest.NewEndpoint("api")
17 changes: 0 additions & 17 deletions config/rest/api/map.go

This file was deleted.

3 changes: 3 additions & 0 deletions config/rest/api/v1/auth/access-tokens/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Base is the base endpoint for the auth service access tokens REST endpoints
var Base = typesrest.NewEndpoint("access-tokens")

// Auth service access tokens REST endpoints
var (
ValidByJwtId = typesrest.NewEndpoint(
Expand Down
11 changes: 11 additions & 0 deletions config/rest/api/v1/auth/access-tokens/handlers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package access_tokens

import (
grpcauth "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/config/grpc/auth"
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Auth service access tokens endpoints handlers
var (
IsAccessTokenValidHandler = typesrest.NewHandler(ValidByJwtId, grpcauth.IsAccessTokenValid)
)
14 changes: 0 additions & 14 deletions config/rest/api/v1/auth/access-tokens/interceptions.go

This file was deleted.

11 changes: 0 additions & 11 deletions config/rest/api/v1/auth/access-tokens/map.go

This file was deleted.

15 changes: 0 additions & 15 deletions config/rest/api/v1/auth/children.go

This file was deleted.

3 changes: 3 additions & 0 deletions config/rest/api/v1/auth/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Base is the base endpoint for the auth service REST endpoints
var Base = typesrest.NewEndpoint("auth")

// Auth service REST endpoints
var (
LogIn = typesrest.NewEndpoint("log-in")
Expand Down
12 changes: 12 additions & 0 deletions config/rest/api/v1/auth/handlers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package auth

import (
grpcauth "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/config/grpc/auth"
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Auth service endpoints handlers
var (
LogInHandler = typesrest.NewHandler(LogIn, grpcauth.LogIn)
LogOutHandler = typesrest.NewHandler(LogOut, grpcauth.LogOut)
)
17 changes: 0 additions & 17 deletions config/rest/api/v1/auth/interceptions.go

This file was deleted.

27 changes: 0 additions & 27 deletions config/rest/api/v1/auth/map.go

This file was deleted.

3 changes: 3 additions & 0 deletions config/rest/api/v1/auth/permissions/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Base is the base endpoint for the auth service permissions REST endpoints
var Base = typesrest.NewEndpoint("permissions")

// Auth service permissions REST endpoints
var (
Relative = typesrest.NewEndpoint("")
Expand Down
14 changes: 14 additions & 0 deletions config/rest/api/v1/auth/permissions/handlers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package permissions

import (
grpcauth "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/config/grpc/auth"
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Auth service permissions endpoints handlers
var (
GetPermissionsHandler = typesrest.NewHandler(Relative, grpcauth.GetPermissions)
AddPermissionHandler = typesrest.NewHandler(Relative, grpcauth.AddPermission)
GetPermissionHandler = typesrest.NewHandler(ByPermissionId, grpcauth.GetPermission)
RevokePermissionHandler = typesrest.NewHandler(ByPermissionId, grpcauth.RevokePermission)
)
19 changes: 0 additions & 19 deletions config/rest/api/v1/auth/permissions/interceptions.go

This file was deleted.

11 changes: 0 additions & 11 deletions config/rest/api/v1/auth/permissions/map.go

This file was deleted.

3 changes: 3 additions & 0 deletions config/rest/api/v1/auth/refresh-tokens/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Base is the base endpoint for the auth service refresh tokens REST endpoints
var Base = typesrest.NewEndpoint("refresh-tokens")

// Auth service refresh tokens REST endpoints
var (
Relative = typesrest.NewEndpoint("")
Expand Down
16 changes: 16 additions & 0 deletions config/rest/api/v1/auth/refresh-tokens/handlers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package refresh_tokens

import (
grpcauth "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/config/grpc/auth"
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Auth service refresh tokens endpoints handlers
var (
RefreshTokenHandler = typesrest.NewHandler(Relative, grpcauth.RefreshToken)
GetRefreshTokensInformationHandler = typesrest.NewHandler(Relative, grpcauth.GetRefreshTokensInformation)
RevokeRefreshTokensHandler = typesrest.NewHandler(Relative, grpcauth.RevokeRefreshTokens)
GetRefreshTokenInformationHandler = typesrest.NewHandler(ByJwtId, grpcauth.GetRefreshTokenInformation)
RevokeRefreshTokenHandler = typesrest.NewHandler(ByJwtId, grpcauth.RevokeRefreshToken)
IsRefreshTokenValidHandler = typesrest.NewHandler(ValidByJwtId, grpcauth.IsRefreshTokenValid)
)
23 changes: 0 additions & 23 deletions config/rest/api/v1/auth/refresh-tokens/interceptions.go

This file was deleted.

11 changes: 0 additions & 11 deletions config/rest/api/v1/auth/refresh-tokens/map.go

This file was deleted.

3 changes: 3 additions & 0 deletions config/rest/api/v1/auth/role-permissions/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Base is the base endpoint for the auth service role permissions REST endpoints
var Base = typesrest.NewEndpoint("role-permissions")

// Auth service role permissions REST endpoints
var (
ByRoleId = typesrest.NewEndpoint(
Expand Down
11 changes: 11 additions & 0 deletions config/rest/api/v1/auth/role-permissions/handlers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package role_permissions

import (
grpcauth "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/config/grpc/auth"
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Auth service role permissions endpoints handlers
var (
RevokeRolePermissionHandler = typesrest.NewHandler(ByRoleId, grpcauth.RevokeRolePermission)
)
14 changes: 0 additions & 14 deletions config/rest/api/v1/auth/role-permissions/interceptions.go

This file was deleted.

11 changes: 0 additions & 11 deletions config/rest/api/v1/auth/role-permissions/map.go

This file was deleted.

3 changes: 3 additions & 0 deletions config/rest/api/v1/auth/roles/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Base is the base endpoint for the auth service roles REST endpoints
var Base = typesrest.NewEndpoint("roles")

// Auth service roles REST endpoints
var (
Relative = typesrest.NewEndpoint("")
Expand Down
15 changes: 15 additions & 0 deletions config/rest/api/v1/auth/roles/handlers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package roles

import (
grpcauth "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/config/grpc/auth"
typesrest "github.com/pixel-plaza-dev/uru-databases-2-protobuf-common/types/rest"
)

// Auth service roles endpoints handlers
var (
AddRoleHandler = typesrest.NewHandler(Relative, grpcauth.AddRole)
GetRolesHandler = typesrest.NewHandler(Relative, grpcauth.GetRoles)
AddRolePermissionHandler = typesrest.NewHandler(ByRoleId, grpcauth.AddRolePermission)
GetRolePermissionsHandler = typesrest.NewHandler(ByRoleId, grpcauth.GetRolePermissions)
RevokeRoleHandler = typesrest.NewHandler(ByRoleId, grpcauth.RevokeRole)
)
20 changes: 0 additions & 20 deletions config/rest/api/v1/auth/roles/interceptions.go

This file was deleted.

11 changes: 0 additions & 11 deletions config/rest/api/v1/auth/roles/map.go

This file was deleted.

Loading

0 comments on commit b0ada31

Please sign in to comment.