1717 * License-Filename: LICENSE
1818 */
1919
20+ @file:Suppress(" TooManyFunctions" )
21+
2022package org.eclipse.apoapsis.ortserver.components.authorization.routes
2123
2224import com.auth0.jwt.interfaces.Payload
@@ -77,14 +79,37 @@ fun Route.get(
7779): Route = documentedAuthorized(checker, body) { get(builder, it) }
7880
7981/* *
80- * Create a new [Route] for HTTP POST requests that performs an automatic authorization check using the given [checker].
82+ * Create a new [Route] for HTTP GET requests with the given [path] that performs an automatic authorization check
83+ * using the given [checker].
84+ */
85+ fun Route.get (
86+ path : String ,
87+ builder : RouteConfig .() -> Unit ,
88+ checker : AuthorizationChecker ,
89+ body : suspend RoutingContext .() -> Unit
90+ ): Route = documentedAuthorized(checker, body) { get(path, builder, it) }
91+
92+ /* *
93+ * Create a new [Route] for HTTP POST requests that performs an automatic authorization check using the given
94+ * [checker].
8195 */
8296fun Route.post (
8397 builder : RouteConfig .() -> Unit ,
8498 checker : AuthorizationChecker ,
8599 body : suspend RoutingContext .() -> Unit
86100): Route = documentedAuthorized(checker, body) { post(builder, it) }
87101
102+ /* *
103+ * Create a new [Route] for HTTP POST requests with the given [path] that performs an automatic authorization check
104+ * using the given [checker].
105+ */
106+ fun Route.post (
107+ path : String ,
108+ builder : RouteConfig .() -> Unit ,
109+ checker : AuthorizationChecker ,
110+ body : suspend RoutingContext .() -> Unit
111+ ): Route = documentedAuthorized(checker, body) { post(path, builder, it) }
112+
88113/* *
89114 * Create a new [Route] for HTTP PATCH requests that performs an automatic authorization check using the given
90115 * [checker].
@@ -95,6 +120,17 @@ fun Route.patch(
95120 body : suspend RoutingContext .() -> Unit
96121): Route = documentedAuthorized(checker, body) { patch(builder, it) }
97122
123+ /* *
124+ * Create a new [Route] for HTTP PATCH requests with the given [path] that performs an automatic authorization check
125+ * using the given [checker].
126+ */
127+ fun Route.patch (
128+ path : String ,
129+ builder : RouteConfig .() -> Unit ,
130+ checker : AuthorizationChecker ,
131+ body : suspend RoutingContext .() -> Unit
132+ ): Route = documentedAuthorized(checker, body) { patch(path, builder, it) }
133+
98134/* *
99135 * Create a new [Route] for HTTP PUT requests that performs an automatic authorization check using the given
100136 * [checker].
@@ -105,6 +141,17 @@ fun Route.put(
105141 body : suspend RoutingContext .() -> Unit
106142): Route = documentedAuthorized(checker, body) { put(builder, it) }
107143
144+ /* *
145+ * Create a new [Route] for HTTP PUT requests with the given [path] that performs an automatic authorization check
146+ * using the given [checker].
147+ */
148+ fun Route.put (
149+ path : String ,
150+ builder : RouteConfig .() -> Unit ,
151+ checker : AuthorizationChecker ,
152+ body : suspend RoutingContext .() -> Unit
153+ ): Route = documentedAuthorized(checker, body) { put(path, builder, it) }
154+
108155/* *
109156 * Create a new [Route] for HTTP DELETE requests that performs an automatic authorization check using the given
110157 * [checker].
@@ -115,6 +162,17 @@ fun Route.delete(
115162 body : suspend RoutingContext .() -> Unit
116163): Route = documentedAuthorized(checker, body) { delete(builder, it) }
117164
165+ /* *
166+ * Create a new [Route] for HTTP DELETE requests with the given [path] that performs an automatic authorization check
167+ * using the given [checker].
168+ */
169+ fun Route.delete (
170+ path : String ,
171+ builder : RouteConfig .() -> Unit ,
172+ checker : AuthorizationChecker ,
173+ body : suspend RoutingContext .() -> Unit
174+ ): Route = documentedAuthorized(checker, body) { delete(path, builder, it) }
175+
118176/* *
119177 * Generic function to create a new [Route] that performs an automatic authorization check using the given [checker].
120178 * The content of the route is defined by the given original [body] and the [build] function.
0 commit comments