Skip to content

Commit

Permalink
Merge pull request #22 from umjammer/0.1.11
Browse files Browse the repository at this point in the history
0.1.11
  • Loading branch information
umjammer authored May 4, 2024
2 parents 6a63c57 + ec97cca commit 367bf69
Show file tree
Hide file tree
Showing 90 changed files with 45 additions and 213 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>vavi</groupId>
<artifactId>vavi-net-auth</artifactId>
<version>0.1.10</version>
<version>0.1.11</version>

<modules>
<module>vavi-net-auth-common</module>
Expand All @@ -19,7 +19,7 @@

<properties>
<vavi-commons-net.groupId>com.github.umjammer</vavi-commons-net.groupId> <!-- vavi -->
<vavi-commons-net.version>1.0.7</vavi-commons-net.version>
<vavi-commons-net.version>1.0.9</vavi-commons-net.version>
</properties>

<packaging>pom</packaging>
Expand Down Expand Up @@ -80,7 +80,7 @@
<dependency>
<groupId>vavi</groupId>
<artifactId>vavi-net-auth-common</artifactId>
<version>0.1.10</version>
<version>0.1.11</version>
</dependency>
<dependency>
<!-- tiny http server for oauth -->
Expand All @@ -100,7 +100,7 @@
<dependency>
<groupId>vavi</groupId>
<artifactId>vavi-net-auth-common</artifactId>
<version>0.1.10</version>
<version>0.1.11</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
Expand Down
43 changes: 17 additions & 26 deletions vavi-net-auth-amazon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>vavi</groupId>
<artifactId>vavi-net-auth</artifactId>
<version>0.1.10</version>
<version>0.1.11</version>
</parent>

<artifactId>vavi-net-auth-amazon</artifactId>
Expand All @@ -32,22 +32,18 @@
</profile>

<profile>
<id>local (not on CI)</id>
<id>local</id>
<activation>
<file>
<exists>${basedir}/local.properties</exists>
</file>
<property>
<name>env.JITPACK</name>
<value>!true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<version>1.2.1</version>
<executions>
<execution>
<phase>initialize</phase>
Expand All @@ -62,29 +58,24 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<trimStackTrace>false</trimStackTrace>
<argLine>
-Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties
</argLine>
<environmentVariables>
<TEST_AMAZON_ACCOUNT>${test.account}</TEST_AMAZON_ACCOUNT>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<trimStackTrace>false</trimStackTrace>
<argLine>
-Djava.util.logging.config.file=${project.build.testResources.testResource.directory}/logging.properties
</argLine>
<environmentVariables>
<TEST_AMAZON_ACCOUNT>${test.account}</TEST_AMAZON_ACCOUNT>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>jitpack.io</id>
Expand Down Expand Up @@ -120,7 +111,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.1.106.Final</version>
<version>4.1.107.Final</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,3 @@ public String authorize(UserCredential userCredential) throws IOException {
return ui.getResult();
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,3 @@ public String getScope() {
return scope;
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ public String authorize(UserCredential userCredential) throws IOException {
return ui.getResult();
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,3 @@ public void close() {
}
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,3 @@ private void refreshToken(String token) {
}
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,3 @@ protected void finalize() {
}
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,3 @@ public WebDriver authorize(UserCredential credential) throws IOException {
return ui.getResult();
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ public String getPassword() {
return password;
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,3 @@ public Exception getException() {
return exception;
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
import vavi.net.auth.UserCredential;
import vavi.net.auth.oauth2.OAuth2AppCredential;
import vavi.net.auth.oauth2.amazon.AmazonBasicAuthenticator;
import vavi.net.auth.oauth2.amazon.AmazonLocalAppCredential;
import vavi.net.auth.web.amazon.AmazonLocalUserCredential;
import vavi.util.Debug;


/**
Expand All @@ -36,13 +38,12 @@ public static void main(String[] args) throws Exception {

@Test
@Disabled("doesn't work 2022-03-08")
@EnabledIfEnvironmentVariable(named = "TEST_AMAZON_ACCOUNT", matches = ".*")
void process() throws IOException {
String email = System.getenv("TEST_AMAZON_ACCOUNT");
OAuth2AppCredential appCredential = new AmazonLocalAppCredential();
UserCredential credential = new AmazonLocalUserCredential(email);
String code = new AmazonBasicAuthenticator(appCredential).authorize(credential);
System.err.println("code: " + code);
Debug.println("code: " + code);
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ void process() throws Exception {
Thread.sleep(5);
}
}

/* */
6 changes: 3 additions & 3 deletions vavi-net-auth-box/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>vavi</groupId>
<artifactId>vavi-net-auth</artifactId>
<version>0.1.10</version>
<version>0.1.11</version>
</parent>

<artifactId>vavi-net-auth-box</artifactId>
Expand Down Expand Up @@ -75,12 +75,12 @@
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.74</version>
<version>1.78</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio-jvm</artifactId>
<version>3.6.0</version>
<version>3.9.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ public String authorize(UserCredential userCredential) throws IOException {
return ui.getResult();
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,3 @@ public BoxAPIConnection authorize(UserCredential userCredential) throws IOExcept
return new BoxAPIConnection(System.getenv("BOX_DEVELOPER_TOKEN"));
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,3 @@ public String getScope() {
return scope;
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ public String authorize(UserCredential userCredential) throws IOException {
return ui.getResult();
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,3 @@ public void close() {
}
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,3 @@ public void onError(BoxAPIConnection api, BoxAPIException error) {
return api;
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,3 @@ protected void finalize() {
}
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,3 @@ public String getPassword() {
return password;
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,3 @@ protected void finalize() {
su.close();
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,3 @@ public static void main(String[] args) throws Exception {
}
}
}

/* */
10 changes: 5 additions & 5 deletions vavi-net-auth-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>vavi</groupId>
<artifactId>vavi-net-auth</artifactId>
<version>0.1.10</version>
<version>0.1.11</version>
</parent>

<artifactId>vavi-net-auth-common</artifactId>
Expand Down Expand Up @@ -39,13 +39,13 @@
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.16.1</version>
<version>4.20.0</version>
</dependency>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<version>4.17.0</version>
<version>4.20.0</version>
</dependency>

<dependency>
Expand All @@ -63,7 +63,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20231013</version>
<version>20240303</version>
</dependency>
<dependency>
<groupId>org.dmfs</groupId>
Expand All @@ -84,7 +84,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.45.0.0</version>
<version>3.45.3.0</version>
<scope>runtime</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ public interface AppCredential {
/** id for authenticate */
String getClientId();
}

/* */
2 changes: 0 additions & 2 deletions vavi-net-auth-common/src/main/java/vavi/net/auth/AuthUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,3 @@ public interface AuthUI<T> {
/** */
Exception getException();
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,3 @@ public interface Authenticator<I, O> {
*/
O authorize(I credential) throws IOException;
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ protected BaseLocalAppCredential() {
}
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ public String getId() {
return id;
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ public interface UserCredential {
/** */
String getPassword();
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ public interface WithTotpUserCredential extends UserCredential {
/** */
String getTotpSecret();
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,3 @@ public void close() {
/* */
public abstract T readRefreshToken() throws IOException;
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,3 @@ public void close() {
super.close();
}
}

/* */
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,3 @@ public void close() {
}
}
}

/* */
Loading

0 comments on commit 367bf69

Please sign in to comment.