dtsybulka commented on a change in pull request #580: CXF-8121 Improve STS REST 
interface
URL: https://github.com/apache/cxf/pull/580#discussion_r341839747
 
 

 ##########
 File path: 
services/sts/sts-rest/src/main/java/org/apache/cxf/sts/rest/api/RealmSecurityTokenService.java
 ##########
 @@ -0,0 +1,251 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.sts.rest.api;
+
+import java.util.List;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.apache.cxf.rs.security.jose.jwk.JsonWebKeys;
+
+import io.swagger.v3.oas.annotations.OpenAPIDefinition;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
+import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
+import io.swagger.v3.oas.annotations.info.Info;
+import io.swagger.v3.oas.annotations.parameters.RequestBody;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.security.SecurityScheme;
+
+@OpenAPIDefinition(
+    info = @Info(title = "SecurityTokenService REST interface", version = "1")
+)
+@SecurityScheme(description = "The JWT token",
+    in = SecuritySchemeIn.HEADER,
+    type = SecuritySchemeType.HTTP,
+    scheme = "Bearer",
+    bearerFormat = "JWT")
+/**
+ * Here possible to declare roles that should have access to the endpoints
+ * @DeclareRoles({"user", "admin"})
+ */
+@Path("/{realm}")
+public interface RealmSecurityTokenService {
 
 Review comment:
   GET methods are usefull for requests with minimal parameters: e.g. get JWT 
token with default list of claims. In case it is necessary to request list of 
claims (very often claim is not just one word but contain full namespace), 
audience URL, GET url will be very long and it is make sense to use POST 
operation with all parameters in body

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to