Skip to content

Commit

Permalink
add satoken dao alone redis
Browse files Browse the repository at this point in the history
  • Loading branch information
naah69 committed Oct 20, 2022
1 parent c68caa2 commit d27dff5
Show file tree
Hide file tree
Showing 63 changed files with 5,237 additions and 289 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ There are some demo in every `integration-tests` module.
- [x] quarkus-satoken-aop(in quarkus-satoken-resteasy)
- [x] quarkus-satoken-dao-redis-jackson(based on quarkus-redisson)
- [x] quarkus-satoken-context-dubbo
- [ ] quarkus-satoken-alone-redis
- [x] quarkus-satoken-alone-redis
- [ ] quarkus-satoken-dao-redis
- [ ] quarkus-satoken-dialect-thymeleaf
- [ ] quarkus-satoken-jwt
Expand Down
1 change: 1 addition & 0 deletions quarkus-satoken-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<artifactId>quarkus-satoken-plugins</artifactId>
<packaging>pom</packaging>
<modules>
<module>quarkus-satoken-dao-alone-redis</module>
<module>quarkus-satoken-dao-redis-jackson</module>
<module>quarkus-satoken-oauth2</module>
<module>quarkus-satoken-sso</module>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-alone-redis-parent</artifactId>
<version>1.30.0</version>
</parent>
<artifactId>quarkus-satoken-dao-alone-redis-deployment</artifactId>
<name>Quarkus Satoken Dao Alone Redis - Deployment</name>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-alone-redis</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-redis-jackson-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5-internal</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>${quarkus.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.satoken.dao.alone.redis.deployment;

import java.io.IOException;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.satoken.dao.alone.redis.runtime.AloneRedisRecorder;

class QuarkusSatokenDaoAloneRedisProcessor {

private static final String FEATURE = "satoken-dao-alone-redis";

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
public SaTokenAloneRedisBuildItem configure(AloneRedisRecorder recorder) throws IOException {
recorder.initAloneRedis();
return new SaTokenAloneRedisBuildItem();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.satoken.dao.alone.redis.deployment;

import io.quarkus.builder.item.SimpleBuildItem;

/**
* SaTokenAloneRedisBuildItem
*
* @author nayan
* @date 2022/10/19 14:57
*/
public final class SaTokenAloneRedisBuildItem extends SimpleBuildItem {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.quarkus.satoken.dao.alone.redis.test;

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusDevModeTest;

public class QuarkusSatokenDaoAloneRedisDevModeTest {

// Start hot reload (DevMode) test with your extension loaded
@RegisterExtension
static final QuarkusDevModeTest devModeTest = new QuarkusDevModeTest()
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));

@Test
public void writeYourOwnDevModeTest() {
// Write your dev mode tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-hot-reload for more information
Assertions.assertTrue(true, "Add dev mode assertions to " + getClass().getName());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.quarkus.satoken.dao.alone.redis.test;

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;

public class QuarkusSatokenDaoAloneRedisTest {

// Start unit test with your extension loaded
@RegisterExtension
static final QuarkusUnitTest unitTest = new QuarkusUnitTest()
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class));

@Test
public void writeYourOwnUnitTest() {
// Write your unit tests here - see the testing extension guide https://quarkus.io/guides/writing-extensions#testing-extensions for more information
Assertions.assertTrue(true, "Add some assertions to " + getClass().getName());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-alone-redis-parent</artifactId>
<version>1.30.0</version>
</parent>
<artifactId>quarkus-satoken-dao-alone-redis-integration-tests</artifactId>
<name>Quarkus Satoken Dao Alone Redis - Integration Tests</name>
<properties>
<skipITs>true</skipITs>
</properties>
<dependencies>
<dependency>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-resteasy</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkiverse.satoken</groupId>
<artifactId>quarkus-satoken-dao-alone-redis</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-redis-client</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native-image</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>${native.surefire.skip}</skipTests>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<skipITs>false</skipITs>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>
Loading

0 comments on commit d27dff5

Please sign in to comment.