Skip to content

Commit

Permalink
Working
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdan committed Aug 25, 2023
1 parent 054514a commit 6417f1b
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 173 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build
*.iws
.idea
target
.DS_Store
.DS_Store
.savant/cache
19 changes: 12 additions & 7 deletions build.savant
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, FusionAuth, All Rights Reserved
* Copyright (c) 2022-2023, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,8 +18,12 @@ project(group: "io.fusionauth", name: "fusionauth-jwt-eddsa", version: "1.0.0",

workflow {
fetch {
// 1. Check local Savant cache
cache()
// 2. Check public Savant repo
url(url: "https://repository.savantbuild.org")
// 3. Pull it from Maven central
maven()
}
publish {
cache()
Expand All @@ -35,7 +39,7 @@ project(group: "io.fusionauth", name: "fusionauth-jwt-eddsa", version: "1.0.0",
dependency(id: "io.fusionauth:fusionauth-jwt:6.0.0-{integration}")
}
group(name: "test-compile", export: false) {
dependency(id: "org.testng:testng:7.3.0")
dependency(id: "org.testng:testng:7.8.0")
}
}

Expand All @@ -47,11 +51,12 @@ project(group: "io.fusionauth", name: "fusionauth-jwt-eddsa", version: "1.0.0",
/*
* Define Plugins
*/
dependency = loadPlugin(id: "org.savantbuild.plugin:dependency:1.0.2")
java = loadPlugin(id: "org.savantbuild.plugin:java:1.2.0")
javaTestNG = loadPlugin(id: "org.savantbuild.plugin:java-testng:1.0.12")
idea = loadPlugin(id: "org.savantbuild.plugin:idea:1.0.1")
release = loadPlugin(id: "org.savantbuild.plugin:release-git:1.0.0")
dependency = loadPlugin(id: "org.savantbuild.plugin:dependency:2.0.0-RC.6")
java = loadPlugin(id: "org.savantbuild.plugin:java:2.0.0-RC.6")
javaTestNG = loadPlugin(id: "org.savantbuild.plugin:java-testng:2.0.0-RC.6")
groovy = loadPlugin(id: "org.savantbuild.plugin:groovy:2.0.0-RC.6")
idea = loadPlugin(id: "org.savantbuild.plugin:idea:2.0.0-RC.7")
release = loadPlugin(id: "org.savantbuild.plugin:release-git:2.0.0-RC.6")

/*
* Plugin Settings
Expand Down
162 changes: 16 additions & 146 deletions fusionauth-jwt-eddsa.iml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
Expand All @@ -26,210 +27,79 @@
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/testng/testng/7.3.0/testng-7.3.0.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/org/testng/testng/7.8.0/testng-7.8.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/testng/testng/7.3.0/testng-7.3.0-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/org/testng/testng/7.8.0/testng-7.8.0-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/beust/jcommander/1.78.0/jcommander-1.78.0.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/beust/jcommander/1.78.0/jcommander-1.78.0-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/inject/guice/4.2.2/guice-no_aop-4.2.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/javax/inject/javax.inject/1.0.0/javax.inject-1.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/javax/inject/javax.inject/1.0.0/javax.inject-1.0.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/aopalliance/aopalliance/1.0.0/aopalliance-1.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/aopalliance/aopalliance/1.0.0/aopalliance-1.0.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/guava/guava/25.1.0-android/guava-25.1.0-android.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/guava/guava/25.1.0-android/guava-25.1.0-android-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/checkerframework/checker-compat-qual/2.0.0/checker-compat-qual-2.0.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/j2objc/j2objc-annotations/1.1.0/j2objc-annotations-1.1.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/j2objc/j2objc-annotations/1.1.0/j2objc-annotations-1.1.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/google/errorprone/error_prone_annotations/2.1.3/error_prone_annotations-2.1.3-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/codehaus/mojo/animal-sniffer-annotations/1.14.0/animal-sniffer-annotations-1.14.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/codehaus/mojo/animal-sniffer-annotations/1.14.0/animal-sniffer-annotations-1.14.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/yaml/snakeyaml/1.21.0/snakeyaml-1.21.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/yaml/snakeyaml/1.21.0/snakeyaml-1.21.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/junit/junit/4.12.0/junit-4.12.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/junit/junit/4.12.0/junit-4.12.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/hamcrest/hamcrest-core/1.3.0/hamcrest-core-1.3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/hamcrest/hamcrest-core/1.3.0/hamcrest-core-1.3.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/apache/ant/ant/1.10.3/ant-1.10.3.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/beust/jcommander/1.82.0/jcommander-1.82.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/apache/ant/ant/1.10.3/ant-1.10.3-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/beust/jcommander/1.82.0/jcommander-1.82.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="TEST">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/org/apache/ant/ant-launcher/1.10.3/ant-launcher-1.10.3.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/org/webjars/jquery/3.6.1/jquery-3.6.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/org/apache/ant/ant-launcher/1.10.3/ant-launcher-1.10.3-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/org/webjars/jquery/3.6.1/jquery-3.6.1-sources.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/fasterxml/jackson/core/jackson-databind/2.13.3/jackson-databind-2.13.3.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/fasterxml/jackson/core/jackson-databind/2.14.0/jackson-databind-2.14.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/fasterxml/jackson/core/jackson-databind/2.13.3/jackson-databind-2.13.3-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/fasterxml/jackson/core/jackson-databind/2.14.0/jackson-databind-2.14.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/fasterxml/jackson/core/jackson-annotations/2.13.3/jackson-annotations-2.13.3.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/fasterxml/jackson/core/jackson-annotations/2.14.0/jackson-annotations-2.14.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/fasterxml/jackson/core/jackson-annotations/2.13.3/jackson-annotations-2.13.3-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/fasterxml/jackson/core/jackson-annotations/2.14.0/jackson-annotations-2.14.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
<orderEntry type="module-library" scope="RUNTIME">
<library>
<CLASSES>
<root url="jar://$USER_HOME$/.savant/cache/com/fasterxml/jackson/core/jackson-core/2.13.3/jackson-core-2.13.3.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/fasterxml/jackson/core/jackson-core/2.14.0/jackson-core-2.14.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.savant/cache/com/fasterxml/jackson/core/jackson-core/2.13.3/jackson-core-2.13.3-src.jar!/" />
<root url="jar://$MODULE_DIR$/.savant/cache/com/fasterxml/jackson/core/jackson-core/2.14.0/jackson-core-2.14.0-src.jar!/" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>

</module>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.3.0</version>
<version>7.8.0</version>
<scope>test</scope>
</dependency>

Expand Down
11 changes: 0 additions & 11 deletions src/main/java/io/fusionauth/jwt/eddsa/EdDSA.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,5 @@ public class EdDSA {
public static KeyType KeyType = new KeyType("OKP", "EdDSA", "1.3.101.112");

private EdDSA() {

}

public static void init() {

}

static {
io.fusionauth.jwt.domain.KeyType.register(EdDSA.KeyType);
io.fusionauth.jwt.domain.Algorithm.register(EdDSA.Algorithm);
io.fusionauth.pem.KeyDecoderFactory.register(EdDSAKeyDecoder.class);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.fusionauth.jwt.eddsa.provider;

import io.fusionauth.jwt.domain.Algorithm;
import io.fusionauth.jwt.eddsa.EdDSA;
import io.fusionauth.jwt.spi.AlgorithmProvider;

public class EdDSAAlgorithmProvider implements AlgorithmProvider {
@Override
public Algorithm get() {
return EdDSA.Algorithm;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.fusionauth.jwt.eddsa.provider;

import io.fusionauth.jwt.eddsa.EdDSAKeyDecoder;
import io.fusionauth.jwt.spi.KeyDecoderProvider;
import io.fusionauth.pem.KeyDecoder;

public class EdDSAKeyDecoderProvider implements KeyDecoderProvider {
@Override
public KeyDecoder get() {
return new EdDSAKeyDecoder();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.fusionauth.jwt.eddsa.provider;

import io.fusionauth.jwt.domain.KeyType;
import io.fusionauth.jwt.eddsa.EdDSA;
import io.fusionauth.jwt.spi.KeyTypeProvider;

public class EdDSAKeyTypeProvider implements KeyTypeProvider {
@Override
public KeyType get() {
return EdDSA.KeyType;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.fusionauth.jwt.eddsa.provider.EdDSAAlgorithmProvider
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.fusionauth.jwt.eddsa.provider.EdDSAKeyDecoderProvider
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.fusionauth.jwt.eddsa.provider.EdDSAKeyTypeProvider
8 changes: 1 addition & 7 deletions src/test/java/io/fusionauth/jwt/BaseTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, FusionAuth, All Rights Reserved
* Copyright (c) 2022-2023, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,15 +21,9 @@
import java.nio.file.Path;
import java.nio.file.Paths;

import io.fusionauth.jwt.eddsa.EdDSA;
import org.testng.Assert;

public abstract class BaseTest {

protected BaseTest() {
EdDSA.init();
}

protected Path getPath(String fileName) {
return Paths.get("src/test/resources/" + fileName);
}
Expand Down

0 comments on commit 6417f1b

Please sign in to comment.