Skip to content

Commit

Permalink
feat: Optimizations. (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniotarricone authored Jun 16, 2023
1 parent 2cd45fc commit e03e081
Show file tree
Hide file tree
Showing 37 changed files with 260 additions and 999 deletions.
7 changes: 7 additions & 0 deletions dep-sha256.json
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,13 @@
"groupId": "io.quarkus",
"version": "3.1.0.Final",
"sha256": "CQrxChOQ6CJAt79ApWF_xW7EmsTzzxsHycigjRBD7eQ="
},
{
"id": "org.projectlombok:lombok:jar:1.18.28",
"artifactId": "lombok",
"groupId": "org.projectlombok",
"version": "1.18.28",
"sha256": "t3TcT8pUMiXYtejBY360E8Q2Oy5hPpUiJ3b3kqjOwOA="
}
]
}
2 changes: 2 additions & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.1.0.Final</quarkus.platform.version>
<skipITs>true</skipITs>
<lombok.version>1.18.28</lombok.version>
<depcheck-plugin.version>1.1.1</depcheck-plugin.version>
<common.version>2.0.2</common.version>
<sonar.host.url>https://sonarcloud.io:443/</sonar.host.url>
Expand Down Expand Up @@ -131,6 +132,12 @@
<artifactId>quarkus-jacoco</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
Expand Down
42 changes: 6 additions & 36 deletions src/main/java/it/pagopa/swclient/mil/auth/bean/AccessToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@
import com.fasterxml.jackson.annotation.JsonProperty;

import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.Getter;

/**
*
* @author Antonio Tarricone
*/
@RegisterForReflection
@JsonInclude(Include.NON_NULL)
@Getter
public class AccessToken {
/*
* access_token
*/
@JsonProperty("access_token")
private String accessToken;
private String accessTokenProper;

/*
* refresh_token
Expand All @@ -44,45 +46,13 @@ public class AccessToken {

/**
*
* @param accessToken
* @param accessTokenProper
* @param refreshToken
* @param expiresIn
*/
public AccessToken(String accessToken, String refreshToken, long expiresIn) {
this.accessToken = accessToken;
public AccessToken(String accessTokenProper, String refreshToken, long expiresIn) {
this.accessTokenProper = accessTokenProper;
this.refreshToken = refreshToken;
this.expiresIn = expiresIn;
}

/**
*
* @return the accessToken
*/
public String getAccessToken() {
return accessToken;
}

/**
*
* @return the refreshToken
*/
public String getRefreshToken() {
return refreshToken;
}

/**
*
* @return the tokenType
*/
public String getTokenType() {
return tokenType;
}

/**
*
* @return the expiresIn
*/
public long getExpiresIn() {
return expiresIn;
}
}
41 changes: 5 additions & 36 deletions src/main/java/it/pagopa/swclient/mil/auth/bean/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
*/
package it.pagopa.swclient.mil.auth.bean;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
*
* @author Antonio Tarricone
*/
@SuppressWarnings("unused")
@AllArgsConstructor
@Getter
public class Client {
/*
*
Expand All @@ -35,39 +39,4 @@ public class Client {
*
*/
private String description;

/**
* @param id
* @param channel
* @param secret
* @param description
*/
public Client(String id, String channel, String salt, String secretHash, String description) {
this.id = id;
this.channel = channel;
this.salt = salt;
this.secretHash = secretHash;
this.description = description;
}

/**
* @return the channel
*/
public String getChannel() {
return channel;
}

/**
* @return the salt
*/
public String getSalt() {
return salt;
}

/**
* @return the secretHash
*/
public String getSecretHash() {
return secretHash;
}
}
101 changes: 4 additions & 97 deletions src/main/java/it/pagopa/swclient/mil/auth/bean/GetAccessToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@
import jakarta.validation.constraints.Size;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.HeaderParam;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
*
* @author Antonio Tarricone
*/
@RegisterForReflection
@ValidationTarget(message = "[" + INCONSISTENT_REQUEST + "] Inconsistent request.")
@NoArgsConstructor
@Getter
public class GetAccessToken {
/*
* Request ID
Expand Down Expand Up @@ -150,101 +154,4 @@ public class GetAccessToken {
@FormParam("client_secret")
@Pattern(regexp = "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$", message = "[" + CLIENT_SECRET_MUST_MATCH_REGEXP + "] client_secret must match \"{regexp}\"")
private String clientSecret;

/**
*
*/
public GetAccessToken() {
}

/**
* @return the acquirerId
*/
public String getAcquirerId() {
return acquirerId;
}

/**
* @return the channel
*/
public String getChannel() {
return channel;
}

/**
* @return the merchantId
*/
public String getMerchantId() {
return merchantId;
}

/**
* @return the terminalId
*/
public String getTerminalId() {
return terminalId;
}

/**
* @return the grantType
*/
public String getGrantType() {
return grantType;
}

/**
* @return the username
*/
public String getUsername() {
return username;
}

/**
* @return the password
*/
public String getPassword() {
return password;
}

/**
* @return the refreshToken
*/
public String getRefreshToken() {
return refreshToken;
}

/**
* @return the extToken
*/
public String getExtToken() {
return extToken;
}

/**
* @return the addData
*/
public String getAddData() {
return addData;
}

/**
* @return the clientId
*/
public String getClientId() {
return clientId;
}

/**
* @return the scope
*/
public String getScope() {
return scope;
}

/**
* @return the clientSecret
*/
public String getClientSecret() {
return clientSecret;
}
}
Loading

0 comments on commit e03e081

Please sign in to comment.