Compare commits

...

4 Commits

Author SHA1 Message Date
Luca Frosini 83bdd68f99 JDK 17 test 2023-10-05 12:00:25 +02:00
Lucio Lelii ade8ae0d7f Add 'CHANGELOG.md' 2023-03-31 15:00:20 +02:00
lucio d0fa2589a7 Merge branch 'master' of
gitea@code-repo.d4science.org:gCubeSystem/authorization-client.git

Conflicts:
	pom.xml
2020-03-18 09:22:49 +01:00
lucio 972820734f get(List<String>) modified for update of authorization service 2020-03-18 09:12:26 +01:00
9 changed files with 19 additions and 138 deletions

7
CHANGELOG.md Normal file
View File

@ -0,0 +1,7 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
# Changelog for legacy Authorization Client
## [v2.0.7] - 2022-06-13
- Release for jenkins build

View File

@ -1 +0,0 @@
${gcube.license}

View File

@ -1,59 +0,0 @@
The gCube System - ${name}
--------------------------------------------------
${description}
${gcube.description}
${gcube.funding}
Version
--------------------------------------------------
${version} (${buildDate})
Please see the file named "changelog.xml" in this directory for the release notes.
Authors
--------------------------------------------------
* Lucio Lelii (lucio.lelii-AT-isti.cnr.it), CNR, Italy
Maintainers
--------------------------------------------------
* Lucio Lelii (lucio.lelii-AT-isti.cnr.it), CNR, Italy
Download information
--------------------------------------------------
Source code is available from SVN:
${scm.url}
Binaries can be downloaded from the gCube website:
${gcube.website}
Installation
--------------------------------------------------
Installation documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}
Documentation
--------------------------------------------------
Documentation is available on-line in the gCube Wiki:
${gcube.wikiRoot}
Support
--------------------------------------------------
Bugs and support requests can be reported in the gCube issue tracking tool:
${gcube.issueTracking}
Licensing
--------------------------------------------------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

View File

@ -1,11 +0,0 @@
<ReleaseNotes>
<Changeset component="authorization-client-1.0.0" date="2015-05-18">
<Change>First Release</Change>
</Changeset>
<Changeset component="authorization-client-2.0.0" date="2016-09-30">
<Change>moving to auth2 service</Change>
</Changeset>
<Changeset component="authorization-client-2.0.1" date="2016-11-25">
<Change>added calls for ExternalServiceToken generator</Change>
</Changeset>
</ReleaseNotes>

View File

@ -1,35 +0,0 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>servicearchive</id>
<formats>
<format>tar.gz</format>
</formats>
<baseDirectory>/</baseDirectory>
<fileSets>
<fileSet>
<directory>${distroDirectory}</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>
<include>README</include>
<include>LICENSE</include>
<include>changelog.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
</fileSets>
<files>
<file>
<source>${distroDirectory}/profile.xml</source>
<outputDirectory>/</outputDirectory>
<filtered>true</filtered>
</file>
<file>
<source>target/${build.finalName}.jar</source>
<outputDirectory>/${artifactId}</outputDirectory>
</file>
</files>
</assembly>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID />
<Type>Service</Type>
<Profile>
<Description>${description}</Description>
<Class>Common</Class>
<Name>${artifactId}</Name>
<Version>1.0.0</Version>
<Packages>
<Software>
<Name>${artifactId}</Name>
<Version>${version}</Version>
<MavenCoordinates>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</MavenCoordinates>
<Files>
<File>${build.finalName}.jar</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-client</artifactId>
<version>2.0.6</version>
<version>2.0.7</version>
<name>authorization service client library</name>
<parent>
@ -17,7 +17,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>2.4.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -117,4 +117,4 @@
</plugins>
</build>
</project>
</project>

View File

@ -513,8 +513,8 @@ public class DefaultAuthorizationProxy implements AuthorizationProxy {
endpoint = getEndpoint(infrastructureHashFromToken);
}
}
final String methodPath = "/token/resolve/?";
final String methodPath = "/token/bunch/?";
StringBuilder callUrl = new StringBuilder(getInternalEnpoint(endpoint))
.append(methodPath);
@ -647,7 +647,7 @@ public class DefaultAuthorizationProxy implements AuthorizationProxy {
@Override
public AuthorizationEndpoint getEndpoint(int infrastructureHash) {
for (String infra: endpoints.getEndpoints().keySet()) {
if (Utils.getInfrastructureHashfromContext(infra)==infrastructureHash)
if (Utils.getInfrastructureHashfromContext(infra)==infrastructureHash)
return endpoints.getEndpoints().get(infra);
}
throw new RuntimeException("Authorization Endpoint not found for the required infrastructure");

View File

@ -39,6 +39,11 @@ public class CallTest {
@Test
public void getToken() throws Exception {
System.out.println(authorizationService().get("a6cec25b-3844-4901-83f3-95eee83319ba-980114272").getClientInfo().getRoles());
System.out.println(authorizationService().get("a6cec25b-3844-4901-83f3-95eee83319ba-980114272").getContext());
}
@Test
public void removeUserinContext() throws Exception {
@ -69,6 +74,7 @@ public class CallTest {
policies.add(new User2ServicePolicy("/gcube/devNext/NextNext", new ServiceAccess(), Users.one("lucio.lelii"), Action.ACCESS ));
authorizationService().addPolicies(policies);
}
@Test
public void getPolicies() throws Exception{