Skip to content

Commit 4889e03

Browse files
authored
Merge pull request #30 from indigo-dc/devel
Update authorization header builders
2 parents a33e0fc + 0e3c917 commit 4889e03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1084
-1104
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The javadoc for this project can be found here: [Javadoc](http://indigo-dc.githu
1313
1.1 REQUISITES
1414
--------------
1515
This project has been created with maven.
16-
To compile it you will need at least **Apache Maven 3.0.5** and **Java 1.7**.
16+
To compile it you will need at least **Apache Maven 3.0.5** and **Java 1.8**.
1717
Maven will take care of downloading all the extra dependencies needed for the project.
1818

1919
1.2 INSTALLING
@@ -57,3 +57,17 @@ InfrastructureUri newInfrastructureUri = im.createInfrastructure(readFile(TOSCA_
5757
im.destroyInfrastructure(getInfrastructureId());
5858
```
5959
The 'im' client always returns a POJO with the information of the call. If an error occurs, an **ImClientErrorException** is thrown. This exception contains the error message and the error code returned by the server.
60+
61+
### 1.4.3 Create authorization headers
62+
Since version 0.4.5 the infrastructure manager allows to use the **AuthorizationHeader** class and different builders to create the authorization headers.
63+
The usage is as follows:
64+
```
65+
AuthorizationHeader ah = new AuthorizationHeader();
66+
Credentials imCred = ImCredentials.buildCredentials().withUsername("user").withPassword("pass");
67+
Credentials vmrcCred = VmrcCredentials.buildCredentials().withUsername("user").withPassword("pass").withHost("host");
68+
Credentials dummyCred = DummyCredential.buildCredentials();
69+
ah.addCredential(imCred);
70+
ah.addCredential(vmrcCred);
71+
ah.addCredential(dummyCred);
72+
InfrastructureManager im = new InfrastructureManager("IM_ENDPOINT", ah);
73+
```

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>es.upv.i3m.grycap</groupId>
55
<artifactId>im-java-api</artifactId>
6-
<version>0.4.5</version>
6+
<version>0.4.6</version>
77
<name>IM Java API</name>
88
<description>Java client for the REST API of the IM</description>
99

@@ -16,7 +16,7 @@
1616
<apache-commons.version>3.4</apache-commons.version>
1717
<junit.version>4.12</junit.version>
1818
<log4j.version>1.2.17</log4j.version>
19-
<java.version>7</java.version>
19+
<java.version>8</java.version>
2020
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
2121
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
2222
<mockserver-netty.version>3.10.4</mockserver-netty.version>

0 commit comments

Comments
 (0)