Skip to content

Commit 058f999

Browse files
authored
Rebrand to polyvariant (#478)
1 parent 303633e commit 058f999

File tree

86 files changed

+402
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+402
-392
lines changed

.jvmopts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-Dfile.encoding=UTF8
2+
-Xms1G
3+
-Xmx5G
4+
-XX:ReservedCodeCacheSize=500M
5+
-XX:+TieredCompilation
6+
-XX:+UseParallelGC

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
[release]: https://github.com/ocadotechnology/sttp-oauth2/releases/latest
2-
[release-badge]: https://img.shields.io/github/release/ocadotechnology/sttp-oauth2.svg
1+
[release]: https://github.com/polyvariant/sttp-oauth2/releases/latest
2+
[release-badge]: https://img.shields.io/github/release/polyvariant/sttp-oauth2.svg
33

44
# sttp-oauth2 - OAuth2 client library for Scala
55

@@ -14,6 +14,14 @@ Currently it supports methods (grant types) for obtaining authorization:
1414

1515
To use this library add the following dependency to your `build.sbt`
1616

17+
Versions 0.19.0 and newer
18+
19+
```scala
20+
"org.polyvariant" %% "sttp-oauth2" % "x.y.z"
21+
```
22+
23+
Versions up to 0.18.0
24+
1725
```scala
1826
"com.ocadotechnology" %% "sttp-oauth2" % "x.y.z"
1927
```
@@ -22,7 +30,7 @@ The latest release is: [![release-badge][]][release]
2230

2331
## Documentation
2432

25-
Visit the documentation at [https://ocadotechnology.github.io/sttp-oauth2](https://ocadotechnology.github.io/sttp-oauth2/) for usage instructions.
33+
Visit the documentation at [https://polyvariant.github.io/sttp-oauth2](https://polyvariant.github.io/sttp-oauth2/) for usage instructions.
2634

2735
## Contributing
2836

@@ -32,4 +40,6 @@ Feel free to submit feature requests and bug reports under Issues.
3240

3341
sttp-oauth2 is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) (the "License"); you may not use this software except in compliance with the License.
3442

35-
Copyright © 2022 Ocado
43+
## Honorable mentions
44+
45+
sttp-oauth2 was initially created by [Ocado Technology](https://github.com/ocadotechnology)

build.sbt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,15 @@ import sbtghactions.UseRef
22

33
inThisBuild(
44
List(
5-
organization := "com.ocadotechnology",
6-
homepage := Some(url("https://github.com/ocadotechnology/sttp-oauth2")),
5+
organization := "com.ocadotechnology", // intentionally left intact just for publishing, will be replaced for 0.19.0
6+
homepage := Some(url("https://github.com/polyvariant/sttp-oauth2")),
77
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
88
developers := List(
99
Developer(
1010
"majk-p",
1111
"Michał Pawlik",
12-
12+
1313
url("https://michalp.net")
14-
),
15-
Developer(
16-
"tplaskowski",
17-
"Tomek Pląskowski",
18-
19-
url("https://github.com/tplaskowski")
20-
),
21-
Developer(
22-
"matwojcik",
23-
"Mateusz Wójcik",
24-
25-
url("https://github.com/matwojcik")
2614
)
2715
),
2816
versionScheme := Some("early-semver")

docs/caching.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ As the user of the library you can either choose to implement your own cache mec
2121

2222
| Class |Description | Import module |
2323
|---------------------------|-------------------------------------------------------------|-------------------|
24-
| `CatsRefExpiringCache` | Simple Cats Effect 3 Ref based implementation. Good enough for `CachingAccessTokenProvider`, but for `CachingTokenIntrospection` it's recommended to use an instance which better handles memory (this instance does not periodically remove expired entries) | `"com.ocadotechnology" %% "sttp-oauth2-cache-cats" % "@VERSION@"` |
25-
| `CatsRefExpiringCache` | Simple Cats Effect 2 Ref based implementation. Good enough for `CachingAccessTokenProvider`, but for `CachingTokenIntrospection` it's recommended to use an instance which better handles memory (this instance does not periodically remove expired entries) | `"com.ocadotechnology" %% "sttp-oauth2-cache-ce2" % "@VERSION@"` |
26-
| `ScalacacheExpiringCache` | Implementation based on https://github.com/cb372/scalacache | `"com.ocadotechnology" %% "sttp-oauth2-cache-scalacache" % "@VERSION@"` |
27-
| `MonixFutureCache` | Future based implementation powered by [Monix](https://monix.io/) | `"com.ocadotechnology" %% "sttp-oauth2-cache-future" % "@VERSION@"` |
24+
| `CatsRefExpiringCache` | Simple Cats Effect 3 Ref based implementation. Good enough for `CachingAccessTokenProvider`, but for `CachingTokenIntrospection` it's recommended to use an instance which better handles memory (this instance does not periodically remove expired entries) | `"org.polyvariant" %% "sttp-oauth2-cache-cats" % "@VERSION@"` |
25+
| `CatsRefExpiringCache` | Simple Cats Effect 2 Ref based implementation. Good enough for `CachingAccessTokenProvider`, but for `CachingTokenIntrospection` it's recommended to use an instance which better handles memory (this instance does not periodically remove expired entries) | `"org.polyvariant" %% "sttp-oauth2-cache-ce2" % "@VERSION@"` |
26+
| `ScalacacheExpiringCache` | Implementation based on https://github.com/cb372/scalacache | `"org.polyvariant" %% "sttp-oauth2-cache-scalacache" % "@VERSION@"` |
27+
| `MonixFutureCache` | Future based implementation powered by [Monix](https://monix.io/) | `"org.polyvariant" %% "sttp-oauth2-cache-future" % "@VERSION@"` |
2828

docs/client-credentials.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: Client credentials grant documentation
1010
- `introspect` the token for its details like `UserInfo`
1111

1212
```scala
13-
import com.ocadotechnology.sttp.oauth2.json.circe.instances._ // Or your favorite JSON implementation
13+
import org.polyvariant.sttp.oauth2.json.circe.instances._ // Or your favorite JSON implementation
1414

1515
val accessTokenProvider = AccessTokenProvider[IO](tokenUrl, clientId, clientSecret)(backend)
1616
val tokenIntrospection = TokenIntrospection[IO](tokenIntrospectionUrl, clientId, clientSecret)(backend)

docs/contributing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ The raw documentation goes through a few steps process before the final website
4242
## Adding JSON implementations
4343
When adding a JSON implementation please follow the subsequent guidelines:
4444
1. Each JSON implementation should exist in a separate module, not to introduce unwanted dependencies.
45-
2. It should expose all necessary `JsonDecoder`s via a single import following the `import com.ocadotechnology.sttp.oauth2.json.<insert-json-library-name-here>.instances._` convention.
46-
3. It should make use of `com.ocadotechnology.sttp.oauth2.json.JsonSpec` test suite to ensure correctness.
45+
2. It should expose all necessary `JsonDecoder`s via a single import following the `import org.polyvariant.sttp.oauth2.json.<insert-json-library-name-here>.instances._` convention.
46+
3. It should make use of `org.polyvariant.sttp.oauth2.json.JsonSpec` test suite to ensure correctness.
4747
4. It should be included in the documentation ([JSON Deserialisation](json-deserialisation.md)).

docs/getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ There are multiple JSON implementations, see [JSON deserialisation](json-deseria
1414

1515
To use this library add following dependency to your `build.sbt` file
1616
```scala
17-
"com.ocadotechnology" %% "sttp-oauth2" % "@VERSION@"
18-
"com.ocadotechnology" %% "sttp-oauth2-circe" % "@VERSION@" // Or other, see JSON support
17+
"org.polyvariant" %% "sttp-oauth2" % "@VERSION@"
18+
"org.polyvariant" %% "sttp-oauth2-circe" % "@VERSION@" // Or other, see JSON support
1919
```
2020
## Usage
2121

@@ -25,7 +25,7 @@ Each grant is implemented in an object with explicit return and error types on m
2525

2626
All grant implementations require a set of implicit `JsonDecoder`s, e.g.:
2727
```scala
28-
import com.ocadotechnology.sttp.oauth2.json.circe.instances._
28+
import org.polyvariant.sttp.oauth2.json.circe.instances._
2929
```
3030

3131
See [JSON deserialisation](json-deserialisation.md) for details.

docs/json-deserialisation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ To use [circe](https://github.com/circe/circe) implementation
1212
add the following module to your dependencies:
1313

1414
```scala
15-
"com.ocadotechnology" %% "sttp-oauth2-circe" % "@VERSION@"
15+
"org.polyvariant" %% "sttp-oauth2-circe" % "@VERSION@"
1616
```
1717

1818
Then import appropriate set of implicit instances:
1919

2020
```scala
21-
import com.ocadotechnology.sttp.oauth2.json.circe.instances._
21+
import org.polyvariant.sttp.oauth2.json.circe.instances._
2222
```
2323

2424
## jsoniter-scala
2525
To use [jsoniter-scala](https://github.com/plokhotnyuk/jsoniter-scala) implementation
2626
add the following module to your dependencies:
2727

2828
```scala
29-
"com.ocadotechnology" %% "sttp-oauth2-jsoniter" % "@VERSION@"
29+
"org.polyvariant" %% "sttp-oauth2-jsoniter" % "@VERSION@"
3030
```
3131

3232
Then import appropriate set of implicit instances:
3333

3434
```scala
35-
import com.ocadotechnology.sttp.oauth2.json.jsoniter.instances._
35+
import org.polyvariant.sttp.oauth2.json.jsoniter.instances._
3636
```

docs/migrating.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,48 @@ description: Migrations
77

88
Some releases introduce breaking changes. This page aims to list those and provide migration guide.
99

10-
## [v0.17.0-RC-1](https://github.com/ocadotechnology/sttp-oauth2/releases/tag/v0.17.0)
10+
## [v0.17.0-RC-1](https://github.com/polyvariant/sttp-oauth2/releases/tag/v0.17.0)
1111

1212
Significant changes were introduced due to separation of JSON deserialisation from the core. Adding a module
1313
with chosen JSON implementation is now required, as is importing an associated set of `JsonDecoder`s.
1414

1515
For backwards compatibility just add `circe` module:
1616

1717
```scala
18-
"com.ocadotechnology" %% "sttp-oauth2-circe" % "0.16.0"
18+
"org.polyvariant" %% "sttp-oauth2-circe" % "0.16.0"
1919
```
2020

2121
and a following import where you were using `sttp-oauth2`:
2222

2323
```scala
24-
import com.ocadotechnology.sttp.oauth2.json.circe.instances._
24+
import org.polyvariant.sttp.oauth2.json.circe.instances._
2525
```
2626

27-
## [v0.16.0](https://github.com/ocadotechnology/sttp-oauth2/releases/tag/v0.16.0)
27+
## [v0.16.0](https://github.com/polyvariant/sttp-oauth2/releases/tag/v0.16.0)
2828

29-
Minor change [#336](https://github.com/ocadotechnology/sttp-oauth2/pull/336) removed implicit parameter
29+
Minor change [#336](https://github.com/polyvariant/sttp-oauth2/pull/336) removed implicit parameter
3030
of `cats.MonadThrow` in some methods. As long as your code just uses these methods (doesn't override or mock
3131
interfaces), you have to only solve warnings suggesting that there are unused parameters. Otherwise,
3232
remove `: MonadError` from inherited implementations.
3333

3434
Affected classes: `PasswordGrant`, `PasswordGrantProvider`, `SttpOauth2ClientCredentialsBackend`, `UserInfoProvider`
3535

36-
## [v0.15.0](https://github.com/ocadotechnology/sttp-oauth2/releases/tag/v0.15.0)
36+
## [v0.15.0](https://github.com/polyvariant/sttp-oauth2/releases/tag/v0.15.0)
3737

3838
### Breaking change in authorization code grant
3939

40-
In [#273](https://github.com/ocadotechnology/sttp-oauth2/pull/273) we have switched from using `withPath` to `addPath` in `AuthorizationCode` and `AuthorizationCodeProvider`.
40+
In [#273](https://github.com/polyvariant/sttp-oauth2/pull/273) we have switched from using `withPath` to `addPath` in `AuthorizationCode` and `AuthorizationCodeProvider`.
4141

4242
If you were instantiating `AuthorizationCodeProvider` or using `AuthorizationCode` providing `baseUri` with path included, this would strip the path. Since `0.15.0` this is no longer the case. If you relied on this behavior, please remove the path from the provided URL before creating the instance.
4343

44-
## [v0.14.0](https://github.com/ocadotechnology/sttp-oauth2/releases/tag/v0.14.0)
44+
## [v0.14.0](https://github.com/polyvariant/sttp-oauth2/releases/tag/v0.14.0)
4545

4646
Due to Scala 3 support `Scope.refine` Refined macro has been removed. Scope object now extends `RefinedTypeOps[Scope, String]`.
4747
To parse `Scope` use `Scope.of` or other functions provided by `RefinedTypeOps` - `from`, `unsafeFrom` or `unapply`.
4848

49-
Since this version, scope is also made optional in [#199](https://github.com/ocadotechnology/sttp-oauth2/pull/199) to match the [spec](https://datatracker.ietf.org/doc/html/rfc6749#section-3.3).
49+
Since this version, scope is also made optional in [#199](https://github.com/polyvariant/sttp-oauth2/pull/199) to match the [spec](https://datatracker.ietf.org/doc/html/rfc6749#section-3.3).
5050

51-
## [v0.12.0](https://github.com/ocadotechnology/sttp-oauth2/releases/tag/v0.12.0)
51+
## [v0.12.0](https://github.com/polyvariant/sttp-oauth2/releases/tag/v0.12.0)
5252

5353
### `SttpBackend` no more passed as implicit param
5454

@@ -89,7 +89,7 @@ CachingAccessTokenProvider.refCacheInstance[IO](accessTokenProvider).map { cachi
8989
}
9090
```
9191

92-
For details please see [PR](https://github.com/ocadotechnology/sttp-oauth2/pull/149).
92+
For details please see [PR](https://github.com/polyvariant/sttp-oauth2/pull/149).
9393

9494
### Apply
9595

@@ -106,14 +106,14 @@ ClientCredentialsProvider[IO](tokenUrl, tokenIntrospectionUrl, clientId, clientS
106106
```
107107

108108

109-
## [v0.10.0](https://github.com/ocadotechnology/sttp-oauth2/releases/tag/v0.5.0)
109+
## [v0.10.0](https://github.com/polyvariant/sttp-oauth2/releases/tag/v0.5.0)
110110

111111
`authCodeToToken` and `refreshAccessToken` no longer return fixed token response type. Instead, they require `RT <: OAuth2TokenResponse.Basic: Decoder` type parameter, that describes desired. response structure.
112112

113113
There are two matching pre-defined types provided:
114114
- `OAuth2TokenResponse` - minimal response as described by [rfc6749](https://datatracker.ietf.org/doc/html/rfc6749#section-5.1)
115115
- `ExtendedOAuth2TokenResponse` - previously known as `Oauth2TokenResponse`, the previously fixed response type. Use this for backward compatiblity.
116116

117-
## [v0.5.0](https://github.com/ocadotechnology/sttp-oauth2/releases/tag/v0.5.0)
117+
## [v0.5.0](https://github.com/polyvariant/sttp-oauth2/releases/tag/v0.5.0)
118118

119-
This version introduces [sttp3](https://github.com/ocadotechnology/sttp-oauth2/pull/39). Please see [sttp v3.0.0 release](https://github.com/softwaremill/sttp/releases/tag/v3.0.0) for migration guide.
119+
This version introduces [sttp3](https://github.com/polyvariant/sttp-oauth2/pull/39). Please see [sttp v3.0.0 release](https://github.com/softwaremill/sttp/releases/tag/v3.0.0) for migration guide.

oauth2-cache-cats/src/main/scala/com/ocadotechnology/sttp/oauth2/cache/cats/CachingAccessTokenProvider.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
package com.ocadotechnology.sttp.oauth2.cache.cats
1+
package org.polyvariant.sttp.oauth2.cache.cats
22

33
import cats.data.OptionT
44
import cats.effect.kernel.Clock
55
import cats.effect.kernel.Concurrent
66
import cats.effect.kernel.MonadCancelThrow
77
import cats.effect.std.Semaphore
88
import cats.syntax.all._
9-
import com.ocadotechnology.sttp.oauth2.AccessTokenProvider
10-
import com.ocadotechnology.sttp.oauth2.ClientCredentialsToken
11-
import com.ocadotechnology.sttp.oauth2.Secret
12-
import com.ocadotechnology.sttp.oauth2.cache.ExpiringCache
13-
import com.ocadotechnology.sttp.oauth2.cache.cats.CachingAccessTokenProvider.TokenWithExpirationTime
14-
import com.ocadotechnology.sttp.oauth2.common.Scope
9+
import org.polyvariant.sttp.oauth2.AccessTokenProvider
10+
import org.polyvariant.sttp.oauth2.ClientCredentialsToken
11+
import org.polyvariant.sttp.oauth2.Secret
12+
import org.polyvariant.sttp.oauth2.cache.ExpiringCache
13+
import org.polyvariant.sttp.oauth2.cache.cats.CachingAccessTokenProvider.TokenWithExpirationTime
14+
import org.polyvariant.sttp.oauth2.common.Scope
1515

1616
import java.time.Instant
1717
import scala.concurrent.duration.Duration

0 commit comments

Comments
 (0)