Skip to content

Commit

Permalink
Add user group (#421)
Browse files Browse the repository at this point in the history
* Modify error message

* Add users group management

* - added database update definition
- fixed some tests
- fixed headers and style

* fixed tests

* Implement workaround to get tenants filtered by organization

* Fix style checks

* - fixed test (temporary hack)
- changed copyright header

* fixed test

* fixed test

* fixed configuration endpoint

Co-authored-by: Michele Perniola <[email protected]>
  • Loading branch information
maricaantonacci and mperniola authored Mar 26, 2021
1 parent 8de611e commit f9fd411
Show file tree
Hide file tree
Showing 377 changed files with 638 additions and 159 deletions.
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions docker/launch.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-database-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-database-pv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-database-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-database-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-pv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/orchestrator-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/workflow-database-controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/workflow-database-pv.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/workflow-database-pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
1 change: 1 addition & 0 deletions kubernetes/workflow-database-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#
# Copyright © 2015-2021 I.N.F.N.
# Copyright © 2015-2020 Santer Reply S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
58 changes: 4 additions & 54 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!--
Copyright © 2015-2021 Santer Reply S.p.A.
Copyright © 2015-2021 I.N.F.N.
Copyright © 2015-2020 Santer Reply S.p.A.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,8 +48,8 @@
</scm>

<organization>
<name>Santer Reply S.p.A.</name>
<url>http://www.reply.com</url>
<name>I.N.F.N.</name>
<url>http://www.infn.it</url>
</organization>

<inceptionYear>2015</inceptionYear>
Expand Down Expand Up @@ -750,57 +751,6 @@
<excludes>
<exclude>docker/*.war</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/kubernetes/fluxcd/**</exclude>
<!-- excluded because I.N.F.N. Copyright -->
<exclude>src/main/java/it/reply/orchestrator/config/properties/VaultProperties.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/controller/ConfigurationController.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dal/util/ResourceMetadataToJsonConverter.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/SystemEndpoints.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/QcgService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/Tenant.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/deployment/QcgJobsOrderedIterator.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/vault/VaultSecret.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/enums/PrivateNetworkType.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/exception/VaultJwtTokenExpiredException.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/exception/VaultSecretNotFoundException.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/exception/VaultServiceNotAvailableException.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/resource/CloudProviderEndpointResource.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/ConfigurationService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/ConfigurationServiceImpl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/VaultService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/VaultServiceImpl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/commands/ProviderTimeout.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/deployment/providers/QcgServiceImpl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/deployment/providers/factory/QcgClientFactory.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/utils/OneDataUtils.java</exclude>
<exclude>src/test/java/it/reply/orchestrator/controller/ConfigurationControllerTest.java</exclude>
<exclude>src/test/java/it/reply/orchestrator/service/commands/ProviderTimeoutTest.java</exclude>
<exclude>src/test/java/it/reply/orchestrator/service/deployment/providers/QcgServiceTest.java</exclude>
<exclude>src/test/java/it/reply/orchestrator/service/ConfigurationServiceTest.java</exclude>
<exclude>src/test/java/it/reply/orchestrator/service/VaultServiceTest.java</exclude>
<exclude>src/test/java/it/reply/orchestrator/controller/DeploymentScheduleControllerTest.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/security/IamUserInfo.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/CloudProviderEndpoint.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/workflow/CloudServicesOrderedIterator.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/KubernetesService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/ChronosService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/ComputeService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/MesosFrameworkService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/MarathonService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/CloudService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dto/cmdb/StorageService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/config/properties/XdcClientProperties.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/TemplateServiceImpl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/SlamServiceV1Impl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/security/OAuth2TokenService.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/CloudProviderEndpointServiceImpl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/AbstractCmdbServiceImpl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/deployment/providers/KubernetesServiceImpl.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/deployment/providers/factory/ImClientFactory.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/commands/DeleteTempReplicationRule.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/commands/GetSlam.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/commands/GetCmdbDataUpdate.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/service/commands/PrefilterCloudProviders.java</exclude>
<exclude>src/main/java/it/reply/orchestrator/dal/repository/ReplicationRuleRepository.java</exclude>
</excludes>
</configuration>
</plugin>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/it/reply/orchestrator/Application.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -55,6 +56,11 @@ public class CmdbProperties {
private String tenantsByServiceIdPath =
"/service/id/{serviceId}/has_many/tenants?include_docs=true";

@NotNull
@NonNull
private String tenantsListPath =
"/tenant/list?include_docs=true";

@NotNull
@NonNull
private String tenantsByOrganizationIdPath =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright © 2019 I.N.F.N.
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
* Copyright © 2020-2021 I.N.F.N.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright © 2019 I.N.F.N.
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -74,6 +75,8 @@ public class DeploymentController {
*
* @param createdBy
* created by name
* @param userGroup
* user group
* @param pageable
* {@link Pageable}
* @param pagedAssembler
Expand All @@ -85,17 +88,18 @@ public class DeploymentController {
produces = MediaType.APPLICATION_JSON_VALUE)
public PagedResources<DeploymentResource> getDeployments(
@RequestParam(name = "createdBy", required = false) @Nullable String createdBy,
@RequestParam(name = "userGroup", required = false) @Nullable String userGroup,
@PageableDefault(sort = "createdAt", direction = Direction.DESC) Pageable pageable,
PagedResourcesAssembler<Deployment> pagedAssembler) {

Page<Deployment> deployments = deploymentService.getDeployments(pageable, createdBy);
Page<Deployment> deployments = deploymentService.getDeployments(pageable, createdBy, userGroup);

return pagedAssembler.toResource(deployments, deploymentResourceAssembler,
ControllerLinkBuilder
.linkTo(
DummyInvocationUtils
.methodOn(DeploymentController.class)
.getDeployments(createdBy, pageable, pagedAssembler))
.getDeployments(createdBy, userGroup, pageable, pagedAssembler))
.withSelfRel());

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright © 2015-2021 I.N.F.N.
* Copyright © 2015-2020 Santer Reply S.p.A.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

0 comments on commit f9fd411

Please sign in to comment.