feat: Moved package name from cn.org.codecrafters to com.onixbyte
This commit is contained in:
@@ -66,7 +66,7 @@ implementation 'cn.org.codecrafters:simple-jwt-spring-boot-starter:${simple-jwt-
|
||||
|
||||
We need a `GuidCreator` instance to create JWT ID, though we did implemented a simple `GuidCreator`, but you can still customize it.
|
||||
|
||||
First, please implement the `cn.org.codecrafters.guid.GuidCreator` interface based on your own rules for generating JWT IDs.
|
||||
First, please implement the `com.onixbyte.guid.GuidCreator` interface based on your own rules for generating JWT IDs.
|
||||
|
||||
Then, add the instance of your own guid creator to spring container, whose name is `jtiCreator`.
|
||||
|
||||
|
||||
+5
-5
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.org.codecrafters.simplejwt.autoconfiguration;
|
||||
package com.onixbyte.simplejwt.autoconfiguration;
|
||||
|
||||
import cn.org.codecrafters.guid.GuidCreator;
|
||||
import cn.org.codecrafters.simplejwt.TokenResolver;
|
||||
import cn.org.codecrafters.simplejwt.authzero.AuthzeroTokenResolver;
|
||||
import cn.org.codecrafters.simplejwt.autoconfiguration.properties.SimpleJwtProperties;
|
||||
import com.onixbyte.guid.GuidCreator;
|
||||
import com.onixbyte.simplejwt.TokenResolver;
|
||||
import com.onixbyte.simplejwt.authzero.AuthzeroTokenResolver;
|
||||
import com.onixbyte.simplejwt.autoconfiguration.properties.SimpleJwtProperties;
|
||||
import com.auth0.jwt.interfaces.DecodedJWT;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
+3
-5
@@ -15,14 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.org.codecrafters.simplejwt.autoconfiguration;
|
||||
package com.onixbyte.simplejwt.autoconfiguration;
|
||||
|
||||
import cn.org.codecrafters.guid.GuidCreator;
|
||||
import cn.org.codecrafters.simplejwt.autoconfiguration.conditions.GuidCreatorCondition;
|
||||
import com.onixbyte.guid.GuidCreator;
|
||||
import com.onixbyte.simplejwt.autoconfiguration.conditions.GuidCreatorCondition;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.SearchStrategy;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Conditional;
|
||||
|
||||
+5
-5
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.org.codecrafters.simplejwt.autoconfiguration;
|
||||
package com.onixbyte.simplejwt.autoconfiguration;
|
||||
|
||||
import cn.org.codecrafters.guid.GuidCreator;
|
||||
import cn.org.codecrafters.simplejwt.TokenResolver;
|
||||
import cn.org.codecrafters.simplejwt.autoconfiguration.properties.SimpleJwtProperties;
|
||||
import cn.org.codecrafters.simplejwt.jjwt.JjwtTokenResolver;
|
||||
import com.onixbyte.guid.GuidCreator;
|
||||
import com.onixbyte.simplejwt.TokenResolver;
|
||||
import com.onixbyte.simplejwt.autoconfiguration.properties.SimpleJwtProperties;
|
||||
import com.onixbyte.simplejwt.jjwt.JjwtTokenResolver;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jws;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
package cn.org.codecrafters.simplejwt.autoconfiguration.conditions;
|
||||
package com.onixbyte.simplejwt.autoconfiguration.conditions;
|
||||
|
||||
import cn.org.codecrafters.guid.GuidCreator;
|
||||
import com.onixbyte.guid.GuidCreator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.annotation.Condition;
|
||||
import org.springframework.context.annotation.ConditionContext;
|
||||
@@ -22,7 +22,7 @@ public class GuidCreatorCondition implements Condition {
|
||||
* The condition to create bean {@code jtiCreator}.
|
||||
* <p>
|
||||
* If Spring does not have a bean of type
|
||||
* {@link cn.org.codecrafters.guid.GuidCreator} named {@code jtiCreator}
|
||||
* {@link GuidCreator} named {@code jtiCreator}
|
||||
* in the application context, then create {@code jtiCreator}.
|
||||
*
|
||||
* @param context the spring application context
|
||||
+1
-1
@@ -35,4 +35,4 @@
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
package cn.org.codecrafters.simplejwt.autoconfiguration;
|
||||
package com.onixbyte.simplejwt.autoconfiguration;
|
||||
+7
-6
@@ -15,11 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.org.codecrafters.simplejwt.autoconfiguration.properties;
|
||||
package com.onixbyte.simplejwt.autoconfiguration.properties;
|
||||
|
||||
import cn.org.codecrafters.simplejwt.SecretCreator;
|
||||
import cn.org.codecrafters.simplejwt.autoconfiguration.AuthzeroTokenResolverAutoConfiguration;
|
||||
import cn.org.codecrafters.simplejwt.constants.TokenAlgorithm;
|
||||
import com.onixbyte.simplejwt.SecretCreator;
|
||||
import com.onixbyte.simplejwt.autoconfiguration.AuthzeroTokenResolverAutoConfiguration;
|
||||
import com.onixbyte.simplejwt.constants.TokenAlgorithm;
|
||||
import com.onixbyte.simplejwt.jjwt.JjwtTokenResolver;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@@ -32,7 +33,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* {@code SimpleJwtProperties} provides configuration options for the JWT
|
||||
* algorithm, issuer, and secret. The properties are used by the {@link
|
||||
* AuthzeroTokenResolverAutoConfiguration} and {@link
|
||||
* cn.org.codecrafters.simplejwt.jjwt.JjwtTokenResolver} to set up the
|
||||
* JjwtTokenResolver} to set up the
|
||||
* necessary configurations for JWT generation and validation.
|
||||
* <p>
|
||||
* Developers can customise the JWT algorithm, issuer, and secret by setting
|
||||
@@ -45,7 +46,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "code-crafters.simple-jwt")
|
||||
@ConfigurationProperties(prefix = "onixbyte.simple-jwt")
|
||||
public class SimpleJwtProperties {
|
||||
|
||||
/**
|
||||
+2
-2
@@ -27,9 +27,9 @@
|
||||
* 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
|
||||
* cn.org.codecrafters.simplejwt.TokenResolver} bean with the desired
|
||||
* com.onixbyte.simplejwt.TokenResolver} bean with the desired
|
||||
* configuration.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
package cn.org.codecrafters.simplejwt.autoconfiguration.properties;
|
||||
package com.onixbyte.simplejwt.autoconfiguration.properties;
|
||||
+3
-3
@@ -1,3 +1,3 @@
|
||||
cn.org.codecrafters.simplejwt.autoconfiguration.GuidAutoConfiguration
|
||||
cn.org.codecrafters.simplejwt.autoconfiguration.AuthzeroTokenResolverAutoConfiguration
|
||||
cn.org.codecrafters.simplejwt.autoconfiguration.JjwtTokenResolverAutoConfiguration
|
||||
com.onixbyte.simplejwt.autoconfiguration.GuidAutoConfiguration
|
||||
com.onixbyte.simplejwt.autoconfiguration.AuthzeroTokenResolverAutoConfiguration
|
||||
com.onixbyte.simplejwt.autoconfiguration.JjwtTokenResolverAutoConfiguration
|
||||
Reference in New Issue
Block a user