Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OIDC provider #330

Merged
merged 22 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f7737a1
- code formatting
afabiani Jan 10, 2024
2e8bfed
- Code formatting
afabiani Jan 10, 2024
527b9be
- finalize OIDC implementation
afabiani Jan 11, 2024
b5484bf
- oidc finalize and test-cases
afabiani Jan 11, 2024
af761ad
- code formatting and comments
afabiani Jan 11, 2024
dd710da
Merge branch 'master' of https://github.com/geosolutions-it/geostore …
afabiani Jan 29, 2024
6ec2293
Merge branch 'master' of https://github.com/geosolutions-it/geostore …
afabiani Mar 7, 2024
38a805f
- code formatting and comments
afabiani Mar 7, 2024
63032cd
- Revert back spring-version to 5.3.18
afabiani Mar 7, 2024
d2e3fd0
- Removing responseMode and allowBearerToken
afabiani Mar 13, 2024
c38e17c
- Document usePKCE and sendClientSecret params
afabiani Mar 13, 2024
eb924e0
Merge branch 'master' of https://github.com/geosolutions-it/geostore …
afabiani Mar 19, 2024
96110fd
- fix beans instantiation
afabiani Mar 19, 2024
bb051ff
- fix beans instantiation
afabiani Mar 19, 2024
ec146fe
- fix beans instantiation
afabiani Mar 19, 2024
34e88d0
- fix beans instantiation
afabiani Mar 19, 2024
1895fd5
- Adding more log messages
afabiani Mar 19, 2024
f75b815
- Enforcing auth code extraction
afabiani Mar 19, 2024
0d796fb
- Allowing ID Token Validation
afabiani Mar 19, 2024
094892a
- Forwarding OIDC Request attributes to the Token Services
afabiani Mar 29, 2024
8d8c11e
Merge branch 'master' of https://github.com/geosolutions-it/geostore …
afabiani Mar 29, 2024
32b331f
- Fix test cases
afabiani Mar 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/modules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses />.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* http://www.geo-solutions.it
*
* GPLv3 + Classpath exception
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Expand All @@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
* along with this program.
*
* ====================================================================
*
Expand All @@ -29,22 +29,20 @@

import it.geosolutions.geostore.core.model.UserGroup;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.List;

/**
* Class ExtGroupList.
*
*
* @author Mirco Bertelli (mirco.bertelli at geo-solutions.it)
*
*/
@XmlRootElement(name = "ExtGroupList")
public class ExtGroupList {
private long count;

private long count;

private List<UserGroup> list;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* http://www.geo-solutions.it
*
* GPLv3 + Classpath exception
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Expand All @@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
* along with this program.
*
* ====================================================================
*
Expand All @@ -30,17 +30,15 @@

import it.geosolutions.geostore.core.model.Resource;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.List;

/**
* Class ExtResourceList.
*
*
* @author Tobia di Pisa (tobia.dipisa at geo-solutions.it)
*
*/
@XmlRootElement(name = "ExtResourceList")
public class ExtResourceList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* http://www.geo-solutions.it
*
* GPLv3 + Classpath exception
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Expand All @@ -16,7 +16,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
* along with this program.
*
* ====================================================================
*
Expand All @@ -30,17 +30,15 @@

import it.geosolutions.geostore.core.model.User;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import java.util.List;

/**
* Class ExtUserList.
*
*
* @author Tobia di Pisa (tobia.dipisa at geo-solutions.it)
*
*/
@XmlRootElement(name = "ExtUserList")
public class ExtUserList {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* http://www.geo-solutions.it
*
* GPLv3 + Classpath exception
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
Expand All @@ -17,7 +17,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.
* along with this program.
*
* ====================================================================
*
Expand All @@ -36,131 +36,123 @@
import it.geosolutions.geostore.services.rest.exception.BadRequestWebEx;
import it.geosolutions.geostore.services.rest.exception.InternalErrorWebEx;
import it.geosolutions.geostore.services.rest.exception.NotFoundWebEx;
import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.springframework.security.access.annotation.Secured;

import javax.annotation.security.RolesAllowed;
import javax.ws.rs.Consumes;
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.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.SecurityContext;

import org.apache.cxf.jaxrs.ext.multipart.Multipart;
import org.springframework.security.access.annotation.Secured;

/**
* Interface RESTExtJsService.
*
*
* @author Tobia di Pisa (tobia.dipisa at geo-solutions.it)
*
*/
public interface RESTExtJsService {

@GET
@Path("/search/{nameLike}")
@Produces({ MediaType.APPLICATION_JSON })
@Secured({ "ROLE_ADMIN", "ROLE_USER", "ROLE_ANONYMOUS" })
@Produces({MediaType.APPLICATION_JSON})
@Secured({"ROLE_ADMIN", "ROLE_USER", "ROLE_ANONYMOUS"})
String getAllResources(@Context SecurityContext sc,
@PathParam("nameLike") String nameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit)
@PathParam("nameLike") String nameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit)
throws BadRequestWebEx;

@GET
@Path("/search/category/{categoryName}")
@Produces({ MediaType.APPLICATION_JSON })
@Secured({ "ROLE_ADMIN", "ROLE_USER", "ROLE_ANONYMOUS" })
@Produces({MediaType.APPLICATION_JSON})
@Secured({"ROLE_ADMIN", "ROLE_USER", "ROLE_ANONYMOUS"})
String getResourcesByCategory(@Context SecurityContext sc,
@PathParam("categoryName") String categoryName,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData)
@PathParam("categoryName") String categoryName,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData)
throws BadRequestWebEx, InternalErrorWebEx;

@GET
@Path("/search/category/{categoryName}/{resourceNameLike}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
@RolesAllowed({ "ADMIN", "USER", "GUEST" })
@Produces({MediaType.APPLICATION_JSON, MediaType.TEXT_XML})
@RolesAllowed({"ADMIN", "USER", "GUEST"})
String getResourcesByCategory(@Context SecurityContext sc,
@PathParam("categoryName") String categoryName,
@PathParam("resourceNameLike") String resourceNameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData)
@PathParam("categoryName") String categoryName,
@PathParam("resourceNameLike") String resourceNameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData)
throws BadRequestWebEx, InternalErrorWebEx;

@GET
@Path("/search/category/{categoryName}/{resourceNameLike}/{extraAttributes}")
@Produces({ MediaType.APPLICATION_JSON })
@RolesAllowed({ "ADMIN", "USER", "GUEST" })
@Produces({MediaType.APPLICATION_JSON})
@RolesAllowed({"ADMIN", "USER", "GUEST"})
String getResourcesByCategory(@Context SecurityContext sc,
@PathParam("categoryName") String categoryName,
@PathParam("resourceNameLike") String resourceNameLike,
@PathParam("extraAttributes") String extraAttributes,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData)
@PathParam("categoryName") String categoryName,
@PathParam("resourceNameLike") String resourceNameLike,
@PathParam("extraAttributes") String extraAttributes,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData)
throws BadRequestWebEx, InternalErrorWebEx;

@POST
@GET
@Path("/search/list")
@Produces({ MediaType.TEXT_XML, MediaType.APPLICATION_JSON })
@Consumes({ MediaType.APPLICATION_XML, MediaType.TEXT_XML })
@Secured({ "ROLE_ADMIN", "ROLE_USER", "ROLE_ANONYMOUS" })
@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
@Consumes({MediaType.APPLICATION_XML, MediaType.TEXT_XML})
@Secured({"ROLE_ADMIN", "ROLE_USER", "ROLE_ANONYMOUS"})
ExtResourceList getExtResourcesList(@Context SecurityContext sc,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData,
@Multipart("filter") SearchFilter filter)
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes,
@QueryParam("includeData") @DefaultValue("false") boolean includeData,
@Multipart("filter") SearchFilter filter)
throws BadRequestWebEx, InternalErrorWebEx;

@GET
@Path("/search/users/{nameLike}")
@Produces({ MediaType.APPLICATION_JSON })
@Secured({ "ROLE_ADMIN"})
@Produces({MediaType.APPLICATION_JSON})
@Secured({"ROLE_ADMIN"})
ExtUserList getUsersList(@Context SecurityContext sc,
@PathParam("nameLike") String nameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes)
@PathParam("nameLike") String nameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("includeAttributes") @DefaultValue("false") boolean includeAttributes)
throws BadRequestWebEx;

/**
* Search for groups by name and return paginated results.
* @param sc security context
*
* @param sc security context
* @param nameLike a substring in the name
* @param start the n-th group shown as first in results.
* @param limit max entries per page
* @param all if <code>true</code> return also 'everyone' group
* @param start the n-th group shown as first in results.
* @param limit max entries per page
* @param all if <code>true</code> return also 'everyone' group
* @return
* @throws BadRequestWebEx
*/
@GET
@Path("/search/groups/{nameLike}")
@Produces({ MediaType.TEXT_XML, MediaType.APPLICATION_JSON })
@Secured({ "ROLE_ADMIN", "ROLE_USER"})
@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
@Secured({"ROLE_ADMIN", "ROLE_USER"})
ExtGroupList getGroupsList(@Context SecurityContext sc,
@PathParam("nameLike") String nameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("all") @DefaultValue("false") boolean all)
@PathParam("nameLike") String nameLike,
@QueryParam("start") Integer start,
@QueryParam("limit") Integer limit,
@QueryParam("all") @DefaultValue("false") boolean all)
throws BadRequestWebEx;

@GET
@Path("/resource/{id}")
@Produces({ MediaType.TEXT_XML, MediaType.APPLICATION_JSON })
@Secured({ "ROLE_USER", "ROLE_ADMIN", "ROLE_ANONYMOUS" })
@Produces({MediaType.TEXT_XML, MediaType.APPLICATION_JSON})
@Secured({"ROLE_USER", "ROLE_ADMIN", "ROLE_ANONYMOUS"})
ShortResource getResource(@Context SecurityContext sc,
@PathParam("id") long id)
throws NotFoundWebEx;
@PathParam("id") long id)
throws NotFoundWebEx;
}
Loading
Loading