Skip to content

Commit

Permalink
[Server] Fix operation name mapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarciani committed Dec 1, 2024
1 parent ba4deae commit 0fb3894
Showing 1 changed file with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,50 @@ import org.springframework.stereotype.Component
class OperationNameProvider {

val OPERATIONS = mapOf(
// Public
Pair(HttpMethod.GET.name(), "/api/open/getDeterministicOutcome") to "GetDeterministicOutcome",
Pair(HttpMethod.GET.name(), "/api/open/getRandomOutcome") to "GetRandomOutcome",

// Administration - Read operations
// Admin - Server
Pair(HttpMethod.GET.name(), "/manage/configprops") to "GetConfig",
Pair(HttpMethod.GET.name(), "/manage/env") to "GetEnv",
Pair(HttpMethod.GET.name(), "/manage/health") to "GetHealth",
Pair(HttpMethod.GET.name(), "/manage/info") to "GetInfo",
Pair(HttpMethod.GET.name(), "/manage/mappings") to "GetMappings",
Pair(HttpMethod.GET.name(), "/manage/metrics") to "GetMetrics",
Pair(HttpMethod.GET.name(), "/manage/openapi") to "GetOpenApi",
Pair(HttpMethod.GET.name(), "/manage/prometheus") to "GetPrometheus",
Pair(HttpMethod.GET.name(), "/manage/swagger-ui") to "GetSwaggerUi",

// Administration - Write operations
Pair(HttpMethod.POST.name(), "/manage/shutdown") to "ManageShutdown",

// Admin - Email
Pair(HttpMethod.POST.name(), "/admin/mail") to "SendMail",

// Documentation
Pair(HttpMethod.GET.name(), "/manage/openapi") to "GetOpenApi",
Pair(HttpMethod.GET.name(), "/manage/swagger-ui") to "GetSwaggerUi",

// Authentication
Pair(HttpMethod.POST.name(), "/api/auth/login") to "Login",
Pair(HttpMethod.POST.name(), "/api/auth/logout") to "Logout",

// Users management
Pair(HttpMethod.POST.name(), "/api/users/createUsers") to "CreateUsers",
Pair(HttpMethod.DELETE.name(), "/api/users/deleteUsers") to "DeleteUsers",
Pair(HttpMethod.GET.name(), "/api/users/describeUsers") to "DescribeUsers",
Pair(HttpMethod.GET.name(), "/api/users/listUsers") to "ListUsers",
Pair(HttpMethod.PATCH.name(), "/api/users/updateUsers") to "UpdateUsers",
Pair(HttpMethod.POST.name(), "/auth/login") to "Login",
Pair(HttpMethod.POST.name(), "/auth/logout") to "Logout",
Pair(HttpMethod.POST.name(), "/auth/admin/tokens") to "RefreshAuthentication",

// Users - Creation
Pair(HttpMethod.POST.name(), "/users/{username}") to "CreateUser",
Pair(HttpMethod.POST.name(), "/users/{username}/activation") to "ActivateUser",
Pair(HttpMethod.GET.name(), "/users/{username}/tokens/activation") to "SendUserActivationToken",

// Users - Deletion
Pair(HttpMethod.DELETE.name(), "/users/{username}") to "DeleteUser",
Pair(HttpMethod.GET.name(), "/users/{username}/tokens/deletion") to "SendUserDeletionToken",

// Users - Password
Pair(HttpMethod.PATCH.name(), "/users/{username}/password") to "ResetPassword",
Pair(HttpMethod.GET.name(), "/users/{username}/tokens/password") to "SendPasswordResetToken",

// Users - Profile
Pair(HttpMethod.GET.name(), "/users/{username}/profile") to "GetUserProfile",
Pair(HttpMethod.PATCH.name(), "/users/{username}/profile") to "UpdateUserProfile",
Pair(HttpMethod.DELETE.name(), "/users/{username}/picture") to "DeleteUserPicture",
Pair(HttpMethod.PATCH.name(), "/users/{username}/picture") to "UpdateUserPicture",

// Users - Settings
Pair(HttpMethod.GET.name(), "/users/{username}/setting") to "GetUserSettings",
Pair(HttpMethod.PATCH.name(), "/users/{username}/settings") to "UpdateUserSettings",

// Simple
Pair(HttpMethod.GET.name(), "/simple/outcome") to "GetOutcome",
Expand Down

0 comments on commit 0fb3894

Please sign in to comment.