chore: removed lombok and upgraded copyright

This commit is contained in:
zihluwang
2025-01-25 19:53:04 +08:00
parent f771b1af19
commit 971037f160
48 changed files with 220 additions and 507 deletions
@@ -24,7 +24,8 @@ import com.onixbyte.simplejwt.autoconfiguration.properties.SimpleJwtProperties;
import com.auth0.jwt.interfaces.DecodedJWT;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.onixbyte.simplejwt.constants.TokenAlgorithm;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.AutoConfiguration;
@@ -55,7 +56,6 @@ import org.springframework.context.annotation.Bean;
* @version 1.6.0
* @since 1.0.0
*/
@Slf4j
@AutoConfiguration
@EnableConfigurationProperties(value = {SimpleJwtProperties.class})
@ConditionalOnClass({DecodedJWT.class, AuthzeroTokenResolver.class})
@@ -64,6 +64,8 @@ import org.springframework.context.annotation.Bean;
@AutoConfigureAfter(value = GuidAutoConfiguration.class)
public class AuthzeroTokenResolverAutoConfiguration {
private final static Logger log = LoggerFactory.getLogger(AuthzeroTokenResolverAutoConfiguration.class);
/**
* Constructs a new {@code SimpleJwtAutoConfiguration} instance with the
* provided SimpleJwtProperties.
@@ -19,7 +19,8 @@ package com.onixbyte.simplejwt.autoconfiguration;
import com.onixbyte.guid.GuidCreator;
import com.onixbyte.simplejwt.autoconfiguration.conditions.GuidCreatorCondition;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
@@ -33,10 +34,11 @@ import java.util.UUID;
* @version 1.1.0
* @since 1.0.0
*/
@Slf4j
@AutoConfiguration
public class GuidAutoConfiguration {
private final static Logger log = LoggerFactory.getLogger(GuidAutoConfiguration.class);
/**
* Default constructor.
*/
@@ -18,7 +18,8 @@
package com.onixbyte.simplejwt.autoconfiguration.conditions;
import com.onixbyte.guid.GuidCreator;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;
@@ -32,9 +33,10 @@ import java.util.Objects;
* @version 1.1.0
* @since 1.0.0
*/
@Slf4j
public class GuidCreatorCondition implements Condition {
private final static Logger log = LoggerFactory.getLogger(GuidCreatorCondition.class);
/**
* Default constructor.
*/
@@ -1,38 +0,0 @@
/*
* Copyright (C) 2024-2025 OnixByte.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* <p>
* The classes in this package are responsible for automatically configuring
* the Simple JWT library when it is used in a Spring Boot application. They
* provide default settings and configurations to ensure that the library works
* smoothly and seamlessly without requiring developers to manually configure
* it.
*
*
* <p>
* Developers using the Simple JWT library with Spring Boot do not need to
* explicitly configure the library, as the auto-configuration classes take
* care of setting up the necessary components and configurations
* automatically. However, developers still have the flexibility to customize
* the behavior of the library by providing their own configurations and
* properties.
*
*
* @since 1.0.0
*/
package com.onixbyte.simplejwt.autoconfiguration;
@@ -20,7 +20,6 @@ package com.onixbyte.simplejwt.autoconfiguration.properties;
import com.onixbyte.simplejwt.SecretCreator;
import com.onixbyte.simplejwt.autoconfiguration.AuthzeroTokenResolverAutoConfiguration;
import com.onixbyte.simplejwt.constants.TokenAlgorithm;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
@@ -42,7 +41,6 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* @version 1.1.0
* @since 1.0.0
*/
@Data
@ConfigurationProperties(prefix = "onixbyte.simple-jwt")
public class SimpleJwtProperties {
@@ -79,5 +77,94 @@ public class SimpleJwtProperties {
*/
private String publicKey;
/**
* Algorithm getter.
*
* @return algorithm
*/
public TokenAlgorithm getAlgorithm() {
return algorithm;
}
/**
* Algorithm setter.
*
* @param algorithm the algorithm
*/
public void setAlgorithm(TokenAlgorithm algorithm) {
this.algorithm = algorithm;
}
/**
* Issuer getter.
*
* @return issuer
*/
public String getIssuer() {
return issuer;
}
/**
* Issuer setter.
*
* @param issuer the issuer
*/
public void setIssuer(String issuer) {
this.issuer = issuer;
}
/**
* Secret setter.
*
* @return secret
*/
public String getSecret() {
return secret;
}
/**
* Secret setter.
*
* @param secret the secret
*/
public void setSecret(String secret) {
this.secret = secret;
}
/**
* Private key getter.
*
* @return private key
*/
public String getPrivateKey() {
return privateKey;
}
/**
* Private key setter.
*
* @param privateKey private key
*/
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
/**
* Public key getter.
*
* @return public key
*/
public String getPublicKey() {
return publicKey;
}
/**
* Public key setter.
*
* @param publicKey public key
*/
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
}
@@ -1,35 +0,0 @@
/*
* Copyright (C) 2024-2025 OnixByte.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* The "cn.org.codecrafters.simplejwt.autoconfiguration.properties" package
* contains configuration properties classes used for Simple JWT library
* autoconfiguration. These classes define the properties that can be
* configured in the application's properties file (e.g.,
* application.properties) to customize the behavior and settings of the Simple
* JWT library.
* <p>
* Developers can customize the JWT algorithm, issuer, and secret by setting
* the corresponding properties in the application's properties file with the
* prefix "code-crafters.simple-jwt". The SimpleJwtAutoConfiguration class
* reads these properties and uses them to create the {@link
* com.onixbyte.simplejwt.TokenResolver} bean with the desired
* configuration.
*
* @since 1.0.0
*/
package com.onixbyte.simplejwt.autoconfiguration.properties;