Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
dist: bionic
language: java
jdk:
- openjdk8
- openjdk8

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/

env:
global:
- ORG_GRADLE_PROJECT_sonatypeUsername=samuelg
# Encrypted ORG_GRADLE_PROJECT_sonatypePassword
- secure: "OBdadNWyzpOjj+A8NTefWCZGV6g/W6S1tl0A12qC68WGmTdD1V1ixbZvqVxAx61ghWSd71WY4JqYw+2xdZRhI99XwaZ66qLQofgRpeV/SegzpJgX0myE7qbti/PJeNgInn5+bcQfpHBi9lR0PnOyV5cMbse46mC0HZ82uPnHqUp2ihJEul9Q9+W1uF13L9zBIl5zv5fxw/XaW62g4PZzjRU9ZAt7UWOhvq6BBoKp0SwteoRh9zBVg2VBeJYXudn4jXY1XLiXJxZF4u+SLkQa4nPenLXhJ3hMkKTvaGU+3LV5vxAMpHL6l7GNYyihZQEsnIkltduXp75UmR6gk3X0z2YCXA587Z5TuFljYSe9SHv9itxNoz2W6nt2Tbxy+nGccqtit1M30aV7U7PDQ0B67MyjKKKLaOxmkzqkR2Vwnj5KfI2FAKI/51uW5a6I8RXmR7aIlwKYReKVmX/lFRyrOccvegJvbVnvZh5aN4fGoH7wPlU4qbe0d4hDYu92iZagSbBfoSFtGAHWvRxSTQATMR5GWoLAUUUSF97QmY9k/EHwZP4IPcdmSxGsnpjWwfhaut4GZMa+5LY+BNmHLd6l0LI5ZUBdYclKetLPFIEKCcIO6kDLzFOY9s7570jiAb7DZC0d7rhq6+EN6Bw8tkMKnHmJ+USPziABGG4mm2fkcjU="
# Encrypted SIGNING_PASSWORD (encrypted SIGNING_KEY, Base64 encoded, is set in Travis environment variables)
- secure: "kiyNJ4seS65DZ3+wn12nJStDMbvHv/JZOtRxzx9cnjvO8RUk9Pr0xo5MdAiKo7ad+fgsAYXQubq5P6vdEh/S7syXMcZKVKE8anCzxG4ESlAXFbNyegdImfetfTUM7URbCPXvUcrgSfpkbj5C0s7Lontc5Iy+RaYSa5YD7FAweMkm6QDLtAjq9Kw4pL67Uz3WFkrqxMEhhNcJusM/4RFvhTBdwSCHB5PuYDzwcqACIJlcYPed4g+Psq7NTqbdxQHH3mG6h/nT21hKbkKkFztwULOYbQHTELf7ZHDRESUWP+wobMB4wrwK5Xc505cB1fVwgDrc4k9lPoofKWK7wBm2x+H5ZNclnPQ+b1tqjo5E90xM7peJgt+kYfM3ADPM2RmIM+UJ9ctNH2tvub2YaBTY7KBcs3YnxbBlJzXJEF73BhOwQlL7VIxgoKL6XqH/EvLOaIsrOTZGMWmbnCkMSLf1Xwx0kKHxOWRkrWyD+t0LPOatNtjYF7GFFXgRFyInlijmdzFKCxVClgmTPGhVRbO5GOTtkpk6hLP6Lbr2Ji8lmxclw5VHwQJta1rBh4NnHWOy6/xwR30c774rvvOu/ARnJF1hRRH8FlAHr6RYMFhvkvMETr71/3wXKGQJkt9gkah44Xp2/QHv879BKoGXrcBJuJ7+Au3uztyeyPlbd2o5UqQ="
# Encrypted GH_PAGES_TOKEN
- secure: "ENw/HcUGIy/XUnwTPobm/pH0P1Kzls2+qGHqpuTiM+C9RuZ5FY544eJX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nGccqtit1M30aV7U7PDQ0B67MyjKKKLaOxmkzqkR2Vwnj5KfI2FAKI/51uW5a6I8RXmR7aIlwKYReKVmX/lFRyrOccvegJvbVnvZh5aN4fGoH7wPlU4qbe0d4hDYu92iZagSbBfoSFtGAHWvRxSTQATMR5GWoLAUUUSF97QmY9k/EHwZP4IPcdmSxGsnpjWwfhaut4GZMa+5LY+BNmHLd6l0LI5ZUBdYclKetLPFIEKCcIO6kDLzFOY9s7570jiAb7DZC0d7rhq6+EN6Bw8tkMKnHmJ+USPziABGG4mm2fkcjU="
# Encrypted SIGNING_PASSWORD (encrypted SIGNING_KEY, Base64 encoded, is set in Travis environment variables)
- secure: "kiyNJ4seS65DZ3+wn12nJStDMbvHv/JZOtRxzx9cnjvO8RUk9Pr0xo5MdAiKo7ad+fgsAYXQubq5P6vdEh/S7syXMcZKVKE8anCzxG4ESlAXFbNyegdImfetfTUM7URbCPXvUcrgSfpkbj5C0s7Lontc5Iy+RaYSa5YD7FAweMkm6QDLtAjq9Kw4pL67Uz3WFkrqxMEhhNcJusM/4RFvhTBdwSCHB5PuYDzwcqACIJlcYPed4g+Psq7NTqbdxQHH3mG6h/nT21hKbkKkFztwULOYbQHTELf7ZHDRESUWP+wobMB4wrwK5Xc505cB1fVwgDrc4k9lPoofKWK7wBm2x+H5ZNclnPQ+b1tqjo5E90xM7peJgt+kYfM3ADPM2RmIM+UJ9ctNH2tvub2YaBTY7KBcs3YnxbBlJzXJEF73BhOwQlL7VIxgoKL6XqH/EvLOaIsrOTZGMWmbnCkMSLf1Xwx0kKHxOWRkrWyD+t0LPOatNtjYF7GFFXgRFyInlijmdzFKCxVClgmTPGhVRbO5GOTtkpk6hLP6Lbr2Ji8lmxclw5VHwQJta1rBh4NnHWOy6/xwR30c774rvvOu/ARnJF1hRRH8FlAHr6RYMFhvkvMETr71/3wXKGQJkt9gkah44Xp2/QHv879BKoGXrcBJuJ7+Au3uztyeyPlbd2o5UqQ="
# Encrypted GH_PAGES_TOKEN
- secure: "ENw/HcUGIy/XUnwTPobm/pH0P1Kzls2+qGHqpuTiM+C9RuZ5FY544eJXo+qS972+yJMSAuFxr31u212WlYtWc7gFht5u+qpPIMe9dFvk0vgV+oIUnvS5fB7eKiiayqO4lxKcVYObf3O+HpXXnUAmQWhyXkyXvmfQWwgNgT1Y9gVqY+tJCmDoqmL6Hc15I/IYKhhL+JM0H8LxmiI/iXoUsdWe1Un2PXWE9dQGbRBifprLVvmDC0SlYS5liDwjINGPi49fvdci4kNNOiTQEQlXuLrC6ygBHVDCw9QxWupOLny6LfDqxYlT8eW/CfD2Z27ebPHSe/0Boqc66Fixw8I1k1ABEFK4HAQ7lZ26zwYBUkoKL01hW/Tdm4gjoysnUD/VEzAD5ieIyJo6vd+zGmMxhqlWKkaNV+jfbr6fa3tVeDkv0/hBLg7wCV5SpwgYBwhsJmOQer/cRduI+RIynxHY7kAJifRHEeteDc6x6HnmrmmoUnflsWt9V2uw0CWR7gbdD0qJJx4SHm18yFdMeel5x9TjVLYWL1IOU+1oJWUtyOavqjU+6OT/SHQ7eA7E4PjnWIJj5QLsusnABtAIY7MeXE72JsWmoAZPtggSz05qn/sESboYMOmQB5BlGcgR7B3Dk5ZmHsg8diOJVc3R41wh15gfve0sj/j7vZ+ifmnPYc8="

script:
- ./gradlew clean build
- ./gradlew clean build

before_deploy: ./gradlew javadoc

deploy:
- provider: script
script: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
skip_cleanup: true
on:
repo: schibsted/account-sdk-java
tags: true
- provider: script
script: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
skip_cleanup: true
on:
repo: schibsted/account-sdk-java
tags: true

- provider: pages
skip_cleanup: true
github_token: $GH_PAGES_TOKEN
keep_history: true
local_dir: build/docs/javadoc/
on:
repo: schibsted/account-sdk-java
tags: true
- provider: pages
skip_cleanup: true
github_token: $GH_PAGES_TOKEN
keep_history: true
local_dir: build/docs/javadoc/
on:
repo: schibsted/account-sdk-java
tags: true
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.0.3] - 2022-05-13

Upgrade com.nimbusds:oauth2-oidc-sdk version

## [1.0.2] - 2022-03-10
Expand All @@ -15,7 +17,6 @@ Add support for acr_values query parameter in login flow.

No changes. Only released to migrate from Bintray to Maven Central.


## [1.0.0] - 2020-08-27

Initial public release.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# account-sdk-java

[![Build Status](https://travis-ci.com/schibsted/account-sdk-java.svg?branch=master)](https://travis-ci.com/schibsted/account-sdk-java)

Java SDK for Schibsted account

## Downloading
The SDK is [published on Maven Central](https://search.maven.org/artifact/com.schibsted.account/account-sdk-java) and available via for

The SDK is [published on Maven Central](https://search.maven.org/artifact/com.schibsted.account/account-sdk-java) and
available via for
example Gradle: `implementation 'com.schibsted.account:account-sdk-java:<version>'`.

## Usage
Expand All @@ -14,6 +17,7 @@ Full API documentation (javadoc) is available [here](https://schibsted.github.io
### Quickstart guide

All operations are performed via the `AuthClient`. Instantiate it via the object builder:

```java
import com.schibsted.account.AuthClient;
import com.schibsted.account.ClientCredentials;
Expand All @@ -25,6 +29,7 @@ AuthClient client = new AuthClient.Builder(
```

#### Request a client token

Using your client credentials you can obtain a client token with the necessary scopes:

```java
Expand All @@ -34,6 +39,7 @@ AccessToken accessToken = client.clientCredentialsGrant(<scopes>);
```

#### Request user tokens

When you have an OAuth authorization code you can obtain user tokens:

```java
Expand All @@ -43,13 +49,16 @@ UserTokens userTokens = client.authorizationCodeGrant(<auth code>, <redirect uri
```

If the access token has expired, you can obtain a new one by using the refresh token:

```java
UserTokens refreshed = client.refreshTokenGrant(userTokens.getRefreshToken().getToken());
```

#### Introspect tokens

When you receive a token it can be introspected to get the associated authorization data. There are two methods
of introspection:

* "remote introspection": by making an [introspection request](https://tools.ietf.org/html/rfc7662#section-2.1) the
authorization data is returned from Schibsted account.
* "local introspection": by verifying the signature and the tokens validity, the authorization data can be read directly
Expand Down
84 changes: 0 additions & 84 deletions build.gradle

This file was deleted.

113 changes: 113 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import kotlin.io.encoding.Base64

plugins {
`java-library`
`maven-publish`
signing
alias(libs.plugins.nexus.publish)
}

version = "1.0.3"
group = "com.schibsted.account"

repositories {
mavenCentral()
}

dependencies {
api(libs.api.slf4j.api)

implementation(libs.impl.konghq.unirest)
implementation(libs.impl.nimbusds.oauth2.oidc.sdk)
implementation(libs.impl.logback.classic)
implementation(libs.impl.logback.core)

implementation(libs.test.junit)
implementation(libs.test.mockito)
implementation(libs.test.mock.unirest)
}

java {
withJavadocJar()
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

}

tasks
.withType<JavaCompile>()
.configureEach {
options.isDeprecation = true
}

tasks.test {
addTestListener(
object : TestListener {
override fun beforeSuite(suite: TestDescriptor?) {}
override fun afterSuite(suite: TestDescriptor?, result: TestResult?) {}

override fun beforeTest(testDescriptor: TestDescriptor?) {
logger.lifecycle("Running test: $testDescriptor")
}

override fun afterTest(testDescriptor: TestDescriptor?, result: TestResult?) {}

}
)
}


publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])

pom {
name.set("Schibsted account SDK Java")
packaging = "jar"
description.set("Schibsted account Java SDK ${project.version}")
url.set("https://github.com/schibsted/account-sdk-java")

scm {
connection.set("scm:git:https://github.com/schibsted/account-sdk-java.git")
url.set("https://github.com/schibsted/account-sdk-java")
}

licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}

developers {
developer {
id.set("schibsted-account")
name.set("Schibsted account team")
email.set("[email protected]")
}
}
}
}
}
}

nexusPublishing {
this.repositories {
sonatype()
}
}

@OptIn(kotlin.io.encoding.ExperimentalEncodingApi::class)
signing {
useInMemoryPgpKeys(
System.getenv("SIGNING_KEY")
?.let(Base64::decode)
?.toString(Charsets.UTF_8),
System.getenv("SIGNING_PASSWORD")
)

sign(publishing.publications["mavenJava"])
}
4 changes: 3 additions & 1 deletion docs/developer.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# Developer documentation

## Building

The SDK is built using Gradle:

```bash
./gradlew clean build
```

## Releasing

Currently a release of the SDK is triggered manually:

1. Make sure all changes to be included in the release have been merged into the `master` branch.
Expand All @@ -17,4 +20,3 @@ Currently a release of the SDK is triggered manually:
CHANGELOG in the release description.
1. When the tag is created it will trigger Travis to run all tests, build the new artifacts and publish them to
Artifactory, as well as updating the published JavaDocs.

Loading