Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion api/config/quarkus-realm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2750,7 +2750,6 @@
"firstName": "Local",
"lastName": "Admin",
"enabled": true,

"attributes": {
"voperson_id": ["local_admin_voperson_id"],

Expand Down
6 changes: 6 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<name>status-api</name>
<version>${revision}</version>
<dependencies>
<dependency>
<groupId>org.grnet</groupId>
<artifactId>quarkus-auth</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

<!-- Quarkus core runtime -->
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement;
import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.grnet.status.api.resolvers.TenantNameResolver;
import org.grnet.endpoint.scanner.runtime.SecuredEndpoint;
import org.grnet.status.authorizations.dtos.GroupUserResponse;
import org.grnet.status.authorizations.dtos.MemberRequest;
import org.grnet.status.authorizations.dtos.PartialGroup;
import org.grnet.status.authorizations.interceptors.CheckEntitlements;
import org.grnet.status.authorizations.interceptors.Resolver;
import org.grnet.status.constraints.NotFoundEntity;
import org.grnet.status.dtos.InformativeResponse;
import org.grnet.status.dtos.pagination.PageResource;
Expand All @@ -39,14 +37,13 @@
import org.grnet.status.dtos.tenant.ContactFullDto;
import org.grnet.status.dtos.tenant.TenantRequestDto;
import org.grnet.status.dtos.tenant.TenantResponseDto;
import org.grnet.status.dtos.tenant.invitations.TenantInvitationResponse;
import org.grnet.status.dtos.tenantproject.TenantProjectDeleteDto;
import org.grnet.status.dtos.tenantproject.TenantProjectRequestDto;
import org.grnet.status.dtos.tenantproject.TenantProjectDto;
import org.grnet.status.enums.TenantGroupStatus;
import org.grnet.status.dtos.tenant.alerts.AlertDefinitionRequest;
import org.grnet.status.dtos.tenant.invitations.TenantInvitationResponse;
import org.grnet.status.dtos.tenant.status.TenantStatusDto;
import org.grnet.status.dtos.tenant.status.TenantStatusFullResponse;
import org.grnet.status.dtos.tenantproject.TenantProjectDto;
import org.grnet.status.dtos.tenantproject.TenantProjectRequestDto;
import org.grnet.status.enums.TenantGroupStatus;
import org.grnet.status.repositories.ProjectRepository;
import org.grnet.status.repositories.TenantRepository;
import org.grnet.status.services.*;
Expand All @@ -67,7 +64,7 @@
scheme = "bearer",
bearerFormat = "JWT",
in = SecuritySchemeIn.HEADER)
@CheckEntitlements
//@CheckEntitlements
public class AdminEndpoint {


Expand Down Expand Up @@ -141,6 +138,7 @@ public class AdminEndpoint {
@Path("/tenants")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response create(@Valid TenantRequestDto request) throws IOException {

var response = tenantService.create(request, utility.getUserUniqueIdentifier());
Expand Down Expand Up @@ -187,6 +185,7 @@ public Response create(@Valid TenantRequestDto request) throws IOException {
@DELETE
@Path("/tenants/{id}")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response deleteTenant(@Parameter(
description = "The ID of the tenant to be deleted.",
required = true,
Expand Down Expand Up @@ -247,6 +246,7 @@ public Response deleteTenant(@Parameter(
@Path("/tenants/{id}/group")
@Produces(MediaType.APPLICATION_JSON)
@Authenticated
@SecuredEndpoint
public Response createGroupTenant(
@Parameter(description = "The ID of the tenant to retrieve.",
required = true,
Expand Down Expand Up @@ -306,6 +306,7 @@ public Response createGroupTenant(
@GET
@Path("/tenants")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response getTenantsByPageAndSize(
@Parameter(name = "page", in = QUERY,
description = "Indicates the page number. Page number must be >= 1.")
Expand Down Expand Up @@ -389,6 +390,7 @@ public Response getTenantsByPageAndSize(
@Path("/projects")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response createProject(
@Valid @NotNull(message = "The request body is empty.")
ProjectRequestDto request,
Expand Down Expand Up @@ -437,6 +439,7 @@ public Response createProject(
@GET
@Path("/projects/{id}")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response getProject(
@Parameter(
description = "The ID of the project to retrieve.",
Expand Down Expand Up @@ -494,6 +497,7 @@ public Response getProject(
@PUT
@Path("/projects/{id}")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response updateProject(
@Parameter(
description = "The ID of the project to retrieve.",
Expand Down Expand Up @@ -547,6 +551,7 @@ public Response updateProject(
@DELETE
@Path("/projects/{id}")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response deleteProject(
@Parameter(
description = "The ID of the project to delete.",
Expand Down Expand Up @@ -598,6 +603,7 @@ public Response deleteProject(
@GET
@Path("/projects")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response fetchAllProjects(
@Parameter(name = "Search", in = QUERY,
description = "Search term applied on the Project. ")
Expand Down Expand Up @@ -678,6 +684,7 @@ public Response fetchAllProjects(
@GET
@Path("/projects/{id}/tenants")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response getTenantsByProject(
@Parameter(
description = "The ID of the project to retrieve.",
Expand Down Expand Up @@ -781,6 +788,7 @@ public Response getTenantsByProject(
@Path("/tenant-project")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response assignProjectToTenants(
@Valid @NotNull TenantProjectRequestDto request) {

Expand Down Expand Up @@ -868,6 +876,7 @@ public void setContent(List<TenantProjectDto> content) {
@Path("/contacts")
@Produces(MediaType.APPLICATION_JSON)
@Authenticated
@SecuredEndpoint
public Response getContactsByPageAndSize(
@Parameter(name = "page", in = QUERY,
description = "Indicates the page number. Page number must be >= 1.")
Expand Down Expand Up @@ -971,6 +980,7 @@ public Response fetchGroups(@Parameter(name = "page", in = QUERY,
@GET
@Path("/members")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response fetchMembers(
@Parameter(name = "search", in = QUERY,
description = "Search term applied on members (user id, username, email, first name, last name).")
Expand Down Expand Up @@ -1033,6 +1043,7 @@ public Response fetchMembers(
@Path("/tenants/{id}/notify-ams")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response notifyAms(
@Parameter(
description = "The ID of the tenant to start automation process.",
Expand Down Expand Up @@ -1085,6 +1096,7 @@ public Response notifyAms(
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/tenants/{id}/manual/status")
@SecuredEndpoint
public Response updateStatus(
@PathParam("id")
@Valid @NotFoundEntity(repository = TenantRepository.class, message = "There is no Tenant with the following id: ")
Expand Down Expand Up @@ -1134,6 +1146,7 @@ public Response updateStatus(
@GET
@Path("/invitations")
@Produces(MediaType.APPLICATION_JSON)
@SecuredEndpoint
public Response getInvitation(

@Parameter(name = "search", in = QUERY,
Expand Down Expand Up @@ -1218,6 +1231,7 @@ public Response getInvitation(
@Path("/tenants/{id}/members")
@Produces(MediaType.APPLICATION_JSON)
@Authenticated
@SecuredEndpoint
public Response addMemberToGroup(
@Parameter(description = "The ID of the tenant.",
required = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement;
import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import org.grnet.endpoint.scanner.runtime.SecuredEndpoint;
import org.grnet.status.authorizations.interceptors.CheckEntitlements;
import org.grnet.status.dtos.InformativeResponse;
import org.grnet.status.dtos.encrypt.EncryptRequestDto;
Expand All @@ -34,7 +35,7 @@
scheme = "bearer",
bearerFormat = "JWT",
in = SecuritySchemeIn.HEADER)
@CheckEntitlements(group = "members")
//@CheckEntitlements(group = "members")
public class ReportEndpoint {

@Inject
Expand Down Expand Up @@ -88,7 +89,8 @@ public class ReportEndpoint {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Path("/encrypt")
@CheckEntitlements(roles = {"member"})
// @CheckEntitlements(roles = {"member"})
@SecuredEndpoint
public Response encrypt(EncryptRequestDto request) {

var response = reportService.encrypt(request);
Expand Down
Loading