Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 17574cc3 authored by Wylem Bars's avatar Wylem Bars
Browse files

IUAINFRA-53 | Fix sonar code smells

parent 508bf4f4
No related branches found
No related tags found
1 merge request!4Feature/iuainfra 53
......@@ -15,7 +15,7 @@ public class AsymmetricSignature extends Signature {
*/
public AsymmetricSignature(String algorithm, byte[] privateKey, String privateKeyPassword) {
super(algorithm);
this.privateKey = privateKey;
this.privateKey = privateKey.clone();
this.privateKeyPassword = privateKeyPassword;
}
......@@ -24,7 +24,7 @@ public class AsymmetricSignature extends Signature {
* @return privateKey
*/
public byte[] getPrivateKey() {
return privateKey;
return privateKey.clone();
}
/**
......
......@@ -3,5 +3,5 @@ package net.ihe.gazelle.app.accesstokenproviderapi.business;
/**
* Credential for an audience
*/
public abstract class Credential {
public interface Credential {
}
......@@ -5,7 +5,7 @@ import java.util.Arrays;
/**
* A password
*/
public class Password extends Credential {
public class Password implements Credential {
private byte[] value;
......@@ -13,7 +13,7 @@ public class Password extends Credential {
* constructor
*/
public Password(byte[] value) {
this.value = value;
this.value = value.clone();
}
/**
......@@ -21,7 +21,7 @@ public class Password extends Credential {
* @return value
*/
public byte[] getValue() {
return value;
return value.clone();
}
@Override
......
......@@ -5,14 +5,14 @@ import java.util.Arrays;
/**
* A public key
*/
public class PublicKey extends Credential {
public class PublicKey implements Credential {
private byte[] key;
/**
* constructor
*/
public PublicKey(byte[] key) {
this.key = key;
this.key = key.clone();
}
/**
......@@ -20,7 +20,7 @@ public class PublicKey extends Credential {
* @return key
*/
public byte[] getKey() {
return key;
return key.clone();
}
@Override
......
package net.ihe.gazelle.app.accesstokenproviderapi.business.testuser;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* Test user used for authentication and token content
......@@ -14,8 +10,8 @@ public class TestUser {
private String userId;
private List<String> givenNames = new ArrayList<>();
private String lastName;
private Date birthDate; //fixme Date ?
private String gender; //fixme String ?
private Date birthDate;
private String gender;
private Map<String, String> extensions = new HashMap<>();
/**
......@@ -56,7 +52,7 @@ public class TestUser {
* @return birthDate
*/
public Date getBirthDate() {
return birthDate;
return (Date) birthDate.clone();
}
/**
......@@ -65,7 +61,7 @@ public class TestUser {
* @param birthDate the birthDate
*/
public void setBirthDate(Date birthDate) {
this.birthDate = birthDate;
this.birthDate = (Date) birthDate.clone();
}
/**
......
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