Skip to content

Commit

Permalink
Merge pull request #69 from RootServices/tokensmith
Browse files Browse the repository at this point in the history
tokensmith: tokensmith group id and gradle 5.6.3
  • Loading branch information
tmackenzie authored Oct 25, 2019
2 parents 5ffc04d + ef7306b commit ade3db2
Show file tree
Hide file tree
Showing 110 changed files with 601 additions and 611 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
.gradle
/build/
/out/
gradle.properties

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ sudo: false
language: java

jdk:
- oraclejdk9
- openjdk12

install:
- ./gradlew assemble -x signArchives -i
- ./gradlew assemble -i

script:
- ./gradlew check -x signArchives -i
- ./gradlew check -i

after_failure:
chmod +x $TRAVIS_BUILD_DIR/print_surefire_reports.sh; $TRAVIS_BUILD_DIR/print_surefire_reports.sh
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ key.setKeyId(Optional.of("test-key-id"));
Claim claim = new Claim();
claim.setUriIsRoot(true);

ByteArrayOutputStream actual = subject.alg(Algorithm.RS256)
ByteArrayOutputStream actual = compactBuilder.alg(Algorithm.RS256)
.key(key)
.claims(claim)
.build();
Expand Down
136 changes: 68 additions & 68 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'maven'

group = "org.rootservices"
version = "1.3.1-SNAPSHOT"
archivesBaseName="jwt"

description = """JSON Web Tokens"""

sourceCompatibility = 1.9
targetCompatibility = 1.9

buildscript {
repositories {
mavenCentral()
}
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}

repositories {
mavenCentral()
mavenLocal()
maven {
url = 'http://repo.maven.apache.org/maven2'
}
}

configurations {
deployerJars
}
group = 'net.tokensmith'
version = '1.3.1-SNAPSHOT'
description = 'Interface used in Otter Web Framework to help serializing to/from JSON'

sourceCompatibility = 12
targetCompatibility = 12

ext {
jacksonVersion = '2.8.8'
log4jVersion = '2.11.0'
jacksonVersion = '2.9.10'
log4jVersion = '2.12.1'
mockitoVersion = '2.28.2'
}

dependencies {
Expand All @@ -42,76 +34,84 @@ dependencies {

testImplementation group: 'junit', name: 'junit', version:'4.12'
testImplementation group: 'org.hamcrest', name: 'hamcrest-all', version:'1.3'
testImplementation group: 'org.mockito', name: 'mockito-all', version:'1.9.5'
testCompile "org.mockito:mockito-core:${mockitoVersion}"
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}


task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
from(sourceSets.main.allJava)
}

artifacts {
archives javadocJar, sourcesJar
task javadocJar(type: Jar) {
classifier = 'javadoc'
from(javadoc.destinationDir)
}

signing {
sign configurations.archives
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = 'jwt'
from components.java
artifact sourcesJar
artifact javadocJar

uploadArchives {
repositories {
mavenDeployer {
if(!project.ext.properties.containsKey("ossrhUser")) {
project.ext.ossrhUser = 'wrongUser'
project.ext.ossrhPassword = 'wrongPassword'
}

beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: ossrhUser, password: ossrhPassword)
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUser, password: ossrhPassword)
}
pom.project {
groupId 'org.rootservices'
artifactId project.name
version project.version
name project.name
description project.description
packaging 'jar'
url 'https://github.com/RootServices/jwt'
pom {
name = 'jwt'
packaging = 'jar'
description = 'Java Implementation of JSON Web Tokens'
url = 'https://github.com/RootServices/jwt'

scm {
connection 'git@github.com:RootServices/jwt.git'
developerConnection 'git@github.com:RootServices/jwt.git'
url 'https://github.com/RootServices/jwt'
connection = 'git@github.com:RootServices/jwt.git'
developerConnection = 'git@github.com:RootServices/jwt.git'
url = 'https://github.com/RootServices/jwt'
}

licenses {
license {
name 'The MIT License (MIT)'
url 'https://github.com/RootServices/jwt/blob/development/LICENSE'
name = 'The MIT License (MIT)'
url = 'https://github.com/RootServices/jwt/blob/development/LICENSE'
}
}

developers {
developer {
id 'tmackenzie'
name 'Tom MacKenzie'
email 'tom@rootservices.org'
id = 'tmackenzie'
name = 'Tom MacKenzie'
email = 'tom@tokensmith.net'
}
}
}
}
}
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl

if(!project.ext.properties.containsKey("ossrhUser")) {
project.ext.ossrhUser = 'wrongUser'
project.ext.ossrhPassword = 'wrongPassword'
print "no ossrh user or password"
}
credentials {
username = project.ext.ossrhUser
password = project.ext.ossrhPassword
}
}
}
}

task wrapper(type: Wrapper) {
gradleVersion = '4.6'
signing {
sign publishing.publications.mavenJava
}

javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.3-all.zip
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package org.rootservices.jwt.builder.compact;
package net.tokensmith.jwt.builder.compact;

import net.tokensmith.jwt.entity.jwe.EncryptionAlgorithm;
import net.tokensmith.jwt.entity.jwk.RSAPublicKey;
import net.tokensmith.jwt.entity.jwk.SymmetricKey;
import net.tokensmith.jwt.entity.jwt.header.Algorithm;
import net.tokensmith.jwt.entity.jwt.header.Header;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.rootservices.jwt.builder.exception.CompactException;
import org.rootservices.jwt.config.JwtAppFactory;
import org.rootservices.jwt.entity.jwe.EncryptionAlgorithm;
import org.rootservices.jwt.entity.jwk.RSAPublicKey;
import org.rootservices.jwt.entity.jwk.SymmetricKey;
import org.rootservices.jwt.entity.jwt.header.Algorithm;
import org.rootservices.jwt.entity.jwt.header.Header;
import org.rootservices.jwt.jwe.entity.JWE;
import org.rootservices.jwt.jwe.factory.exception.CipherException;
import org.rootservices.jwt.jwe.serialization.JweSerializer;
import org.rootservices.jwt.jws.signer.factory.rsa.exception.PublicKeyException;
import org.rootservices.jwt.serialization.exception.EncryptException;
import org.rootservices.jwt.serialization.exception.JsonToJwtException;
import net.tokensmith.jwt.builder.exception.CompactException;
import net.tokensmith.jwt.config.JwtAppFactory;
import net.tokensmith.jwt.jwe.entity.JWE;
import net.tokensmith.jwt.jwe.factory.exception.CipherException;
import net.tokensmith.jwt.jwe.serialization.JweSerializer;
import net.tokensmith.jwt.jws.signer.factory.rsa.exception.PublicKeyException;
import net.tokensmith.jwt.serialization.exception.EncryptException;
import net.tokensmith.jwt.serialization.exception.JsonToJwtException;

import java.io.ByteArrayOutputStream;
import java.util.Base64;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.rootservices.jwt.builder.compact;
package net.tokensmith.jwt.builder.compact;

import net.tokensmith.jwt.entity.jwk.Key;
import net.tokensmith.jwt.entity.jwt.Claims;
import net.tokensmith.jwt.entity.jwt.header.Algorithm;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.rootservices.jwt.builder.exception.CompactException;
import org.rootservices.jwt.config.JwtAppFactory;
import org.rootservices.jwt.entity.jwk.Key;
import org.rootservices.jwt.entity.jwt.Claims;
import org.rootservices.jwt.entity.jwt.header.Algorithm;
import org.rootservices.jwt.exception.SignatureException;
import org.rootservices.jwt.jws.serialization.SecureJwtSerializer;
import org.rootservices.jwt.serialization.exception.JwtToJsonException;
import net.tokensmith.jwt.builder.exception.CompactException;
import net.tokensmith.jwt.config.JwtAppFactory;
import net.tokensmith.jwt.exception.SignatureException;
import net.tokensmith.jwt.jws.serialization.SecureJwtSerializer;
import net.tokensmith.jwt.serialization.exception.JwtToJsonException;

import java.io.ByteArrayOutputStream;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.rootservices.jwt.builder.compact;
package net.tokensmith.jwt.builder.compact;

import org.rootservices.jwt.config.JwtAppFactory;
import org.rootservices.jwt.entity.jwt.Claims;
import org.rootservices.jwt.serialization.UnSecureJwtSerializer;
import net.tokensmith.jwt.entity.jwt.Claims;
import net.tokensmith.jwt.config.JwtAppFactory;
import net.tokensmith.jwt.serialization.UnSecureJwtSerializer;

import java.io.ByteArrayOutputStream;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.rootservices.jwt.builder.exception;
package net.tokensmith.jwt.builder.exception;

public class CompactException extends Exception {
public CompactException(String message, Throwable cause) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
package org.rootservices.jwt.config;
package net.tokensmith.jwt.config;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
import net.tokensmith.jwt.entity.jwk.Key;
import net.tokensmith.jwt.entity.jwk.RSAPublicKey;
import net.tokensmith.jwt.entity.jwt.header.Algorithm;
import net.tokensmith.jwt.exception.SignatureException;
import net.tokensmith.jwt.factory.SecureJwtFactory;
import net.tokensmith.jwt.factory.UnSecureJwtFactory;
import net.tokensmith.jwt.jwe.Transformation;
import net.tokensmith.jwt.jwe.factory.CipherRSAFactory;
import net.tokensmith.jwt.jwe.factory.CipherSymmetricFactory;
import net.tokensmith.jwt.jwe.factory.exception.CipherException;
import net.tokensmith.jwt.jwe.serialization.direct.JweDirectDesializer;
import net.tokensmith.jwt.jwe.serialization.direct.JweDirectSerializer;
import net.tokensmith.jwt.jwe.serialization.rsa.JweRsaDeserializer;
import net.tokensmith.jwt.jwe.serialization.rsa.JweRsaSerializer;
import net.tokensmith.jwt.jwk.PrivateKeyFactory;
import net.tokensmith.jwt.jwk.PublicKeyFactory;
import net.tokensmith.jwt.jwk.SecretKeyFactory;
import net.tokensmith.jwt.jws.signer.Signer;
import net.tokensmith.jwt.jws.signer.factory.SignerFactory;
import net.tokensmith.jwt.jws.signer.factory.exception.InvalidAlgorithmException;
import net.tokensmith.jwt.jws.signer.factory.exception.InvalidJsonWebKeyException;
import net.tokensmith.jwt.jws.signer.factory.hmac.MacFactory;
import net.tokensmith.jwt.jws.signer.factory.rsa.PrivateKeySignatureFactory;
import net.tokensmith.jwt.jws.signer.factory.rsa.PublicKeySignatureFactory;
import net.tokensmith.jwt.jws.signer.factory.rsa.exception.PublicKeyException;
import net.tokensmith.jwt.jws.verifier.VerifySignature;
import net.tokensmith.jwt.jws.verifier.factory.VerifySignatureFactory;
import net.tokensmith.jwt.serialization.HeaderDeserializer;
import net.tokensmith.jwt.serialization.JwtSerde;
import net.tokensmith.jwt.serialization.Serdes;
import net.tokensmith.jwt.serialization.UnSecureJwtSerializer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.rootservices.jwt.jwe.serialization.direct.JweDirectDesializer;
import org.rootservices.jwt.jwe.serialization.direct.JweDirectSerializer;
import org.rootservices.jwt.jwe.serialization.rsa.JweRsaSerializer;
import org.rootservices.jwt.jws.serialization.SecureJwtSerializer;
import org.rootservices.jwt.exception.SignatureException;
import org.rootservices.jwt.serialization.JwtSerde;
import org.rootservices.jwt.serialization.Serdes;
import org.rootservices.jwt.serialization.UnSecureJwtSerializer;
import org.rootservices.jwt.entity.jwk.RSAPublicKey;
import org.rootservices.jwt.jwe.Transformation;
import org.rootservices.jwt.jwe.factory.CipherRSAFactory;
import org.rootservices.jwt.jwe.factory.CipherSymmetricFactory;
import org.rootservices.jwt.jwe.factory.exception.CipherException;
import org.rootservices.jwt.jwk.PrivateKeyFactory;
import org.rootservices.jwt.jwk.PublicKeyFactory;
import org.rootservices.jwt.jwk.SecretKeyFactory;
import org.rootservices.jwt.jws.signer.factory.rsa.exception.PublicKeyException;
import org.rootservices.jwt.serialization.HeaderDeserializer;
import org.rootservices.jwt.jwe.serialization.rsa.JweRsaDeserializer;
import org.rootservices.jwt.jws.signer.factory.exception.InvalidAlgorithmException;
import org.rootservices.jwt.jws.signer.factory.exception.InvalidJsonWebKeyException;
import org.rootservices.jwt.factory.SecureJwtFactory;
import org.rootservices.jwt.factory.UnSecureJwtFactory;
import org.rootservices.jwt.entity.jwk.Key;
import org.rootservices.jwt.entity.jwt.header.Algorithm;
import org.rootservices.jwt.jws.signer.factory.hmac.MacFactory;
import org.rootservices.jwt.jws.signer.factory.rsa.PrivateKeySignatureFactory;
import org.rootservices.jwt.jws.signer.factory.rsa.PublicKeySignatureFactory;
import org.rootservices.jwt.jws.verifier.VerifySignature;
import org.rootservices.jwt.jws.signer.Signer;
import org.rootservices.jwt.jws.signer.factory.*;
import org.rootservices.jwt.jws.verifier.factory.VerifySignatureFactory;
import net.tokensmith.jwt.jws.serialization.SecureJwtSerializer;
import net.tokensmith.jwt.jws.signer.factory.*;


import javax.crypto.Cipher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.rootservices.jwt.entity.jwe;
package net.tokensmith.jwt.entity.jwe;

import com.fasterxml.jackson.annotation.JsonValue;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.rootservices.jwt.entity.jwk;
package net.tokensmith.jwt.entity.jwk;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.rootservices.jwt.entity.jwk;
package net.tokensmith.jwt.entity.jwk;

/**
* Created by tommackenzie on 8/19/15.
Expand Down
Loading

0 comments on commit ade3db2

Please sign in to comment.