Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 66247ee1 authored by Malo Toudic's avatar Malo Toudic
Browse files

add javadoc

parent 0d7d85c8
No related branches found
No related tags found
2 merge requests!5Develop,!1Feature/iuainfra 30
Showing
with 116 additions and 0 deletions
......@@ -2,8 +2,16 @@ package net.ihe.gazelle.app.accesstokenproviderapi.adapter.webservice;
import net.ihe.gazelle.app.accesstokenproviderapi.business.Credential;
/**
* Interface to interact with the audience registry where is store all known audience with their credential
*/
public interface AudienceRegistry {
/**
* Get credential's audience
* @param audienceId
* @return credential
*/
Credential getAudienceCredentials(String audienceId);
}
package net.ihe.gazelle.app.accesstokenproviderapi.adapter.webservice;
/**
* For SoapUI integration need, a simplified Authorization Server (or IDP) is required.
*/
public interface DummyAuthzServer {
/**
* get a dummy access token
* @param userId
* @param audienceId
* @param purposeOfUser
* @param resourceId
* @return an access token
*/
byte[] getAccessToken(String userId, String audienceId, String purposeOfUser, String resourceId);
}
......@@ -2,8 +2,15 @@ package net.ihe.gazelle.app.accesstokenproviderapi.adapter.webservice;
import net.ihe.gazelle.app.accesstokenproviderapi.business.testuser.TestUser;
/**
* Interface to interact with the test-users’ database for authentication step and token content
*/
public interface TestUserRegistry {
/**
* @param userId
* @return TestUser
*/
TestUser getTestUser(String userId);
}
......@@ -3,8 +3,16 @@ package net.ihe.gazelle.app.accesstokenproviderapi.adapter.webservice;
import net.ihe.gazelle.app.accesstokenproviderapi.business.AccessTokenRequest;
import net.ihe.gazelle.sb.iua.business.EncodedIUAToken;
/**
* Interface to interact with the access token generator
*/
public interface TokenGenerator {
/**
* generate an access token from an access token request
* @param accessTokenRequest
* @return EncodedIUAToken
*/
EncodedIUAToken generateAccessToken(AccessTokenRequest accessTokenRequest);
}
......@@ -3,6 +3,9 @@ package net.ihe.gazelle.app.accesstokenproviderapi.business;
import java.util.ArrayList;
import java.util.List;
/**
* Extensions for the Access Token
*/
public class AccessTokenExtension {
private String subjectId;
......@@ -208,6 +211,9 @@ public class AccessTokenExtension {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -231,6 +237,9 @@ public class AccessTokenExtension {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
int result = subjectId != null ? subjectId.hashCode() : 0;
result = 31 * result + (subjectOrganizations != null ? subjectOrganizations.hashCode() : 0);
......
......@@ -4,6 +4,9 @@ import net.ihe.gazelle.sb.iua.business.TokenType;
import java.time.Duration;
/**
* The Access Token request
*/
public class AccessTokenRequest {
private String issuer;
......@@ -107,6 +110,9 @@ public class AccessTokenRequest {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -123,6 +129,9 @@ public class AccessTokenRequest {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
int result = issuer.hashCode();
result = 31 * result + subject.hashCode();
......
......@@ -2,6 +2,9 @@ package net.ihe.gazelle.app.accesstokenproviderapi.business;
import java.util.Arrays;
/**
* Asymmetric signature information of the access token
*/
public class AsymmetricSignature extends Signature {
private byte[] privateKey;
......@@ -33,6 +36,9 @@ public class AsymmetricSignature extends Signature {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -45,6 +51,9 @@ public class AsymmetricSignature extends Signature {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
int result = Arrays.hashCode(privateKey);
result = 31 * result + privateKeyPassword.hashCode();
......
package net.ihe.gazelle.app.accesstokenproviderapi.business;
/**
* A Coded value
*/
public class CodedValue {
private String code;
......
package net.ihe.gazelle.app.accesstokenproviderapi.business;
/**
* Credential for an audience
*/
public abstract class Credential {
}
......@@ -2,6 +2,9 @@ package net.ihe.gazelle.app.accesstokenproviderapi.business;
import java.util.Arrays;
/**
* A password
*/
public class Password extends Credential {
private byte[] value;
......@@ -22,6 +25,9 @@ public class Password extends Credential {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -32,6 +38,9 @@ public class Password extends Credential {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
return Arrays.hashCode(value);
}
......
......@@ -2,6 +2,9 @@ package net.ihe.gazelle.app.accesstokenproviderapi.business;
import java.util.Arrays;
/**
* A public key
*/
public class PublicKey extends Credential {
private byte[] key;
......@@ -21,6 +24,9 @@ public class PublicKey extends Credential {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -31,6 +37,9 @@ public class PublicKey extends Credential {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
return Arrays.hashCode(key);
}
......
package net.ihe.gazelle.app.accesstokenproviderapi.business;
/**
* Signature information of the access token
*/
public abstract class Signature {
private String algorithm;
......@@ -20,6 +24,9 @@ public abstract class Signature {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -30,6 +37,9 @@ public abstract class Signature {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
return algorithm.hashCode();
}
......
package net.ihe.gazelle.app.accesstokenproviderapi.business;
/**
* Symmetric signature information of the access token
*/
public class SymmetricSignature extends Signature {
private String secret;
......@@ -21,6 +24,9 @@ public class SymmetricSignature extends Signature {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -32,6 +38,9 @@ public class SymmetricSignature extends Signature {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
return secret.hashCode();
}
......
......@@ -6,6 +6,9 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Test user used for authentication and token content
*/
public class TestUser {
private String userId;
......@@ -15,6 +18,9 @@ public class TestUser {
private String gender; //fixme String ?
private Map<String, String> extensions = new HashMap<>();
/**
* Constructor
*/
public TestUser(String userId, List<String> givenNames, String lastName) {
this.userId = userId;
this.givenNames = givenNames;
......@@ -105,6 +111,9 @@ public class TestUser {
}
@Override
/**
* {@inheritDoc}
*/
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -120,6 +129,9 @@ public class TestUser {
}
@Override
/**
* {@inheritDoc}
*/
public int hashCode() {
int result = userId.hashCode();
result = 31 * result + givenNames.hashCode();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment