Skip to content

Commit

Permalink
Release version 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMicky-FR committed Jul 29, 2022
1 parent 1469d76 commit 56d6f13
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 73 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'temurin'
distribution: temurin
java-version: ${{ matrix.java-version }}

- name: Validate Gradle Wrapper
Expand All @@ -41,22 +41,24 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Setup JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: temurin
java-version: 11

- name: Publish to Sonatype
run: ./gradlew publish
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

- name: Upload artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: AzAuth
path: |
Expand Down
19 changes: 4 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,22 @@ A Java implementation of the Azuriom Auth API.
## Installation

### Maven
```xml
<repositories>
<repository>
<id>sonatype-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
```

```xml
<dependencies>
<dependency>
<groupId>com.azuriom</groupId>
<artifactId>azauth</artifactId>
<version>0.1.0-SNAPSHOT</version>
<version>0.1.0</version>
</dependency>
</dependencies>
```

### Gradle
```groovy
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
}
```

```groovy
dependencies {
implementation 'com.azuriom:azauth:0.1.0-SNAPSHOT'
implementation 'com.azuriom:azauth:0.1.0'
}
```

Expand Down
12 changes: 8 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group 'com.azuriom'
version '0.1.0-SNAPSHOT'
version '0.1.0'

ext {
isReleaseVersion = !version.endsWith('SNAPSHOT')
Expand All @@ -23,7 +23,7 @@ repositories {
}

dependencies {
api 'com.google.code.gson:gson:2.8.9'
api 'com.google.code.gson:gson:2.9.0'
compileOnlyApi 'org.jetbrains:annotations:23.0.0'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
Expand Down Expand Up @@ -85,14 +85,18 @@ publishing {
url = isReleaseVersion ? releasesRepoUrl : snapshotsRepoUrl

credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : System.getenv('SONATYPE_USERNAME')
password = project.hasProperty('ossrhPassword') ? ossrhPassword : System.getenv('SONATYPE_PASSWORD')
username = findProperty('ossrhUsername') ?: System.getenv('SONATYPE_USERNAME')
password = findProperty('ossrhPassword') ?: System.getenv('SONATYPE_PASSWORD')
}
}
}
}

signing {
def signingKey = System.getenv('SIGNING_KEY')
def signingPassword = System.getenv('SIGNING_PASSWORD')

useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

Expand Down
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-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright © 2015-2021 the original authors.
# Copyright ? 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
# * expansions ?$var?, ?${var}?, ?${var:-default}?, ?${var+SET}?,
# ?${var#prefix}?, ?${var%suffix}?, and ?$( cmd )?;
# * compound commands having a testable exit status, especially ?case?;
# * various built-in commands including ?command?, ?set?, and ?ulimit?.
#
# Important for patching:
#
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/com/azuriom/azauth/AzAuthenticator.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ public AzAuthenticator(@NotNull String url) {
}

/**
* Try to authenticate the player on the website and get his profile.
* Try to authenticate the user on the website and get his profile.
*
* @param email the player email
* @param password the player password
* @return the player profile
* @param email the user email
* @param password the user password
* @return the user profile
* @throws AuthenticationException if credentials are not valid
* @throws IOException if an IO exception occurs
*/
Expand All @@ -77,13 +77,13 @@ public AzAuthenticator(@NotNull String url) {
}

/**
* Try to authenticate the player on the website and get his profile with a given response type.
* Try to authenticate the user on the website and get his profile with a given response type.
*
* @param email the player email
* @param password the player password
* @param email the user email
* @param password the user password
* @param responseType the class of the response
* @param <T> the type of the response
* @return the player profile
* @return the user profile
* @throws AuthenticationException if credentials are not valid
* @throws IOException if an IO exception occurs
*/
Expand All @@ -100,8 +100,8 @@ public AzAuthenticator(@NotNull String url) {
/**
* Verify an access token and get the associated profile.
*
* @param accessToken the player access token
* @return the player profile
* @param accessToken the user access token
* @return the user profile
* @throws AuthenticationException if credentials are not valid
* @throws IOException if an IO exception occurs
*/
Expand All @@ -113,10 +113,10 @@ public AzAuthenticator(@NotNull String url) {
/**
* Verify an access token and get the associated profile with a given response type.
*
* @param accessToken the player access token
* @param accessToken the user access token
* @param responseType the class of the response
* @param <T> the type of the response
* @return the player profile
* @return the user profile
* @throws AuthenticationException if credentials are not valid
* @throws IOException if an IO exception occurs
*/
Expand All @@ -133,7 +133,7 @@ public AzAuthenticator(@NotNull String url) {
* Invalidate the given access token.
* To get a new valid access token you need to use {@link #authenticate(String, String)} again.
*
* @param accessToken the player access token
* @param accessToken the user access token
* @throws AuthenticationException if credentials are not valid
* @throws IOException if an IO exception occurs
*/
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/azuriom/azauth/model/Role.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import java.awt.*;
import java.util.Objects;

/**
* Represents a user's role on the website.
*/
public class Role {

private final String name;
Expand Down
59 changes: 31 additions & 28 deletions src/main/java/com/azuriom/azauth/model/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import java.util.Objects;
import java.util.UUID;

/**
* Represents a user on the website.
*/
public class User {

private final String username;
Expand All @@ -21,18 +24,18 @@ public class User {
private final Instant createdAt;

/**
* Create a new PlayerProfile.
* Create a new UserProfile.
*
* @param id the user id on the website
* @param username the player username
* @param uuid the player unique id
* @param accessToken the player access token
* @param email the player email address
* @param username the user username
* @param uuid the user unique id
* @param accessToken the user access token
* @param email the user email address
* @param emailVerified is the email address verified
* @param money the player money
* @param role the player role
* @param banned is the player banned
* @param createdAt the player registration date
* @param money the user money
* @param role the user role
* @param banned is the user banned
* @param createdAt the user registration date
*/
public User(int id, String username, UUID uuid, String accessToken, String email, boolean emailVerified, double money, Role role, boolean banned, Instant createdAt) {
this.id = id;
Expand All @@ -49,52 +52,52 @@ public User(int id, String username, UUID uuid, String accessToken, String email
}

/**
* Gets the player id.
* Gets the user id.
*
* @return the player id
* @return the user id
*/
public int getId() {
return this.id;
}

/**
* Gets the player username.
* Gets the user username.
*
* @return the player username
* @return the user username
*/
public @NotNull String getUsername() {
return this.username;
}

/**
* Gets the player unique id.
* Gets the user unique id.
*
* @return the player unique id
* @return the user unique id
*/
public @NotNull UUID getUuid() {
return this.uuid;
}

/**
* Gets the player access token.
* Gets the user access token.
*
* @return the player access token
* @return the user access token
*/
public @NotNull String getAccessToken() {
return this.accessToken;
}

/**
* Gets the player email.
* Gets the user email.
*
* @return the player email address
* @return the user email address
*/
public @NotNull String getEmail() {
return this.email;
}

/**
* Verify if the player email address is verified.
* Verify if the user email address is verified.
*
* @return {@code true} if the email address is verified, {@code false} otherwise
*/
Expand All @@ -103,36 +106,36 @@ public boolean isEmailVerified() {
}

/**
* Get the player money.
* Get the user money.
*
* @return the player money
* @return the user money
*/
public double getMoney() {
return this.money;
}

/**
* Get the player role.
* Get the user role.
*
* @return the player role
* @return the user role
*/
public @NotNull Role getRole() {
return this.role;
}

/**
* Verify if the player is banned.
* Verify if the user is banned.
*
* @return {@code true} if the player is banned, {@code false} otherwise
* @return {@code true} if the user is banned, {@code false} otherwise
*/
public boolean isBanned() {
return this.banned;
}

/**
* Get the player registration date.
* Get the user registration date.
*
* @return the player registration date
* @return the user registration date
*/
public @NotNull Instant getCreatedAt() {
return this.createdAt;
Expand Down

0 comments on commit 56d6f13

Please sign in to comment.