Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: supabase-community/gotrue-kt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.3.0
Choose a base ref
...
head repository: supabase-community/gotrue-kt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 5 commits
  • 14 files changed
  • 3 contributors

Commits on Feb 1, 2021

  1. Update README.md

    kevcodez authored Feb 1, 2021
    Copy the full SHA
    569b8e8 View commit details

Commits on Feb 11, 2022

  1. feat: add custom deserializer objects for user and token response (#4)

    Add the ability to pass custom deserializer objects for GoTrueUserResponse and the GoTrueTokenResponse to GoTrueClient
    tschuehly authored Feb 11, 2022
    Copy the full SHA
    d413c6c View commit details

Commits on Jun 14, 2022

  1. Copy the full SHA
    6eb86c3 View commit details
  2. Prepare 0.4.0

    kevcodez committed Jun 14, 2022
    Copy the full SHA
    59c7188 View commit details

Commits on Nov 1, 2023

  1. chore: Add link to supabase-kt to in prep for archiving the repo (#6)

    * chore: add link to supabase-kt to warn users about archive
    
    * Update README.md
    dshukertjr authored Nov 1, 2023
    Copy the full SHA
    17c96b1 View commit details
9 changes: 5 additions & 4 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
@@ -13,11 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 8
distribution: corretto
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

9 changes: 5 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -15,11 +15,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
- uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 8
distribution: corretto
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Kotlin Client for GoTrue

> **Warning**
> This repository is archived. Use [supabase-kt](https://github.com/supabase-community/supabase-kt) instead to use Supabase in your Kotlin projects.

Kotlin JVM client for [Netlify's GoTrue API](https://github.com/netlify/gotrue).

Comes with DTOs for the responses to enable type-safe access.
@@ -11,6 +15,7 @@ Comes with DTOs for the responses to enable type-safe access.
## Installation

Maven

```xml
<dependency>
<groupId>io.supabase</groupId>
@@ -21,20 +26,20 @@ Maven
```

Gradle

```groovy
implementation 'io.supabase:gotrue-kt:{version}'
```


## Usage

```kotlin
val goTrueClient = GoTrueDefaultClient(
val goTrueClient = GoTrueClient.defaultGoTrueClient(
url = "<base-url>",
headers = mapOf("Authorization" to "foo", "apiKey" to "bar")
)

try {d
try {
goTrueClient.invite("e@ma.il")

val updatedUser = goTrueClient.updateUser(
@@ -43,14 +48,37 @@ try {d
"admin" = true
)
)

println(updatedUser.updatedAt)
} catch (exc: GoTrueHttpException) {
// Exception is thrown on bad status (anything above 300)
println("Oops, status: ${exc.status}, body:\n${exc.httpBody}")
}
```

You can also customize the DTO for example if you turn off email verification

```kotlin
data class CustomGoTrueUserResponse(
val accessToken: String,
val tokenType: String,
val refreshToken: String,
val user: User
)

data class User(
val id: UUID,
val email: String,
val phone: String

)

GoTrueClient.customApacheJacksonGoTrueClient<CustomGoTrueUserResponse, GoTrueTokenResponse>(
url = "<base-url>",
headers = mapOf("Authorization" to "foo", "apiKey" to "bar")
)
```

If you are using [supabase](https://supabase.io/), the base URL will be `https://<your-project-id>.supabase.co/auth/v1`

## HTTP / (De)-Serialization
@@ -62,8 +90,8 @@ If you want to change that, you need to implement the `GoTrueHttpClient` and the
See [GoTrueHttpClientApache](src/main/kotlin/io/supabase/gotrue/http/GoTrueHttpClientApache.kt) and [GoTrueJsonConverterJackson](src/main/kotlin/io/supabase/gotrue/json/GoTrueJsonConverterJackson.kt).

```kotlin
val goTrueClient = GoTrueClient(
GoTrueClient.goTrueClient<GoTrueUserResponse,GoTrueTokenResponse>(
goTrueHttpClient = { customHttpClient() },
goTrueJsonConverter = customConverter()
)
```
```
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
plugins {
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
id 'org.jetbrains.kotlin.jvm' version '1.4.21'
id 'org.jetbrains.kotlin.jvm' version '1.7.0'

// Apply the java-library plugin for API and implementation separation.
id 'java-library'

id "com.github.ben-manes.versions" version "0.36.0"
id "com.github.ben-manes.versions" version "0.42.0"

id "maven-publish"

id "com.jfrog.bintray" version "1.8.5"
}

String currentVersion = '0.3.0'
String currentVersion = '0.4.0'

group = 'io.supabase'
version = currentVersion

repositories {
jcenter()
mavenCentral()
}

dependencies {

compile "org.apache.httpcomponents.client5:httpclient5:5.0.3"
implementation "org.apache.httpcomponents.client5:httpclient5:5.1.3"

// Align versions of all Kotlin components
implementation platform('org.jetbrains.kotlin:kotlin-bom')

implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'

implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.12.1"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.1"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3"

testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0'
testImplementation "io.mockk:mockk:1.10.5"
testImplementation 'com.willowtreeapps.assertk:assertk-jvm:0.23'
testCompile "com.github.tomakehurst:wiremock-jre8:2.27.2"
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
testImplementation "io.mockk:mockk:1.12.4"
testImplementation 'com.willowtreeapps.assertk:assertk-jvm:0.25'
testImplementation "com.github.tomakehurst:wiremock-jre8:2.33.2"

}

2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Empty file modified gradlew
100644 → 100755
Empty file.
Loading