-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(discord): fixed discord provider
- Loading branch information
1 parent
246dab8
commit c1b18de
Showing
12 changed files
with
156 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
Thank you for your interest in contributing to the Cloudeko Zenei Auth Service! We appreciate your willingness to help improve and enhance this project. | ||
|
||
**Setting Up Your Development Environment** | ||
|
||
1. **Prerequisites** | ||
|
||
* **Java 21:** Ensure you have Java 21 installed. You can download it from [https://openjdk.org/](https://openjdk.org/). | ||
|
||
* **Maven:** Install Maven. Check the installation instructions at [https://maven.apache.org/](https://maven.apache.org/). | ||
|
||
2. **Generate Development Keys** | ||
|
||
* **Execute the Script:** Run the script to create `dev-private-key.pem` and `dev-public-key.pem`. | ||
|
||
```bash | ||
./generate-dev-keys.sh | ||
``` | ||
|
||
3. **Build and Run** | ||
|
||
* **Build:** | ||
|
||
```bash | ||
mvn clean install | ||
``` | ||
|
||
* **Run:** | ||
|
||
```bash | ||
mvn quarkus:dev | ||
``` | ||
|
||
**Making Contributions** | ||
|
||
1. **Fork the Repository** | ||
2. **Create a Branch** | ||
3. **Make Your Changes** | ||
4. **Commit Your Changes** | ||
5. **Push to Your Branch** | ||
6. **Open a Pull Request** | ||
|
||
**Code Style** | ||
|
||
* Please follow the existing code style and formatting. | ||
|
||
**Additional Notes** | ||
|
||
* Ensure your code is well-documented. | ||
* Write unit tests to accompany your changes. | ||
* If you're introducing a new feature or making a significant change, consider opening an issue for discussion beforehand. | ||
**We look forward to your contributions!** | ||
Feel free to ask if you have any questions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Application configuration | ||
# Name of the Quarkus application. This can be used in various places, e.g., metrics. | ||
quarkus.application.name=cloudeko-zenei-auth-service | ||
# Path to a custom banner text file to be displayed on application startup. | ||
quarkus.banner.path=zenei_banner.txt | ||
|
||
# Database configuration | ||
# JDBC driver class for the database connection. | ||
quarkus.datasource.jdbc.driver=org.postgresql.Driver | ||
quarkus.hibernate-orm.database.generation=update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# In 'dev' profile, drop and recreate the database schema on each startup. | ||
quarkus.hibernate-orm.database.generation=drop-and-create | ||
|
||
# Mail configuration | ||
# Use a mock mailer for development, not sending actual emails. | ||
%dev.quarkus.mailer.mock=true | ||
|
||
# Zenei Configuration | ||
# Type of database used by the Zenei application. | ||
zenei.database.db-kind=postgresql | ||
# Location of the private key file for JWT signing. | ||
zenei.jwt.private.key.location=dev-private-key.pem | ||
# Location of the public key file for JWT verification. | ||
zenei.jwt.public.key.location=dev-public-key.pem | ||
# Issuer identifier to be included in generated JWTs. | ||
zenei.jwt.issuer=https://example.com/issuer | ||
|
||
# Default zenei admin user | ||
zenei.user.default.admin.username=admin | ||
zenei.user.default.admin.email=[email protected] | ||
zenei.user.default.admin.password=test | ||
zenei.user.default.admin.role=admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Github OAuth | ||
zenei.external.auth.providers.github.enabled=true | ||
zenei.external.auth.providers.github.client-id=<YOUR_CLIENT_ID> | ||
zenei.external.auth.providers.github.client-secret=<YOUR_CLIENT_SECRET> | ||
zenei.external.auth.providers.github.authorization-uri=https://github.com/login/oauth/authorize | ||
zenei.external.auth.providers.github.token-uri=https://github.com/login/oauth/access_token | ||
zenei.external.auth.providers.github.base-uri=https://api.github.com | ||
zenei.external.auth.providers.github.redirect-uri=http://localhost:8080/external/callback/github | ||
zenei.external.auth.providers.github.scope=user:email | ||
|
||
# Discord OAuth | ||
zenei.external.auth.providers.discord.enabled=true | ||
zenei.external.auth.providers.discord.client-id=<YOUR_CLIENT_ID> | ||
zenei.external.auth.providers.discord.client-secret=<YOUR_CLIENT_SECRET> | ||
zenei.external.auth.providers.discord.authorization-uri=https://discord.com/api/oauth2/authorize | ||
zenei.external.auth.providers.discord.token-uri=https://discord.com/api/oauth2/token | ||
zenei.external.auth.providers.discord.base-uri=https://discord.com/api | ||
zenei.external.auth.providers.discord.redirect-uri=http://localhost:8080/external/callback/discord | ||
zenei.external.auth.providers.discord.scope=identify email |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# In 'test' profile, drop and recreate the database schema on each startup. | ||
quarkus.hibernate-orm.database.generation=drop-and-create | ||
|
||
# Zenei Configuration | ||
# Type of database used by the Zenei application. | ||
zenei.database.db-kind=postgresql | ||
# Location of the private key file for JWT signing. | ||
zenei.jwt.private.key.location=dev-private-key.pem | ||
# Location of the public key file for JWT verification. | ||
zenei.jwt.public.key.location=dev-public-key.pem | ||
# Issuer identifier to be included in generated JWTs. | ||
zenei.jwt.issuer=https://example.com/issuer | ||
|
||
# Default zenei admin user | ||
zenei.user.default.admin.username=admin | ||
zenei.user.default.admin.email=[email protected] | ||
zenei.user.default.admin.password=test | ||
zenei.user.default.admin.role=admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,2 @@ | ||
# Application configuration | ||
# Name of the Quarkus application. This can be used in various places, e.g., metrics. | ||
quarkus.application.name=cloudeko-zenei-auth-service | ||
# Path to a custom banner text file to be displayed on application startup. | ||
quarkus.banner.path=zenei_banner.txt | ||
|
||
# Database configuration | ||
# JDBC driver class for the database connection. | ||
quarkus.datasource.jdbc.driver=org.postgresql.Driver | ||
# Hibernate ORM strategy for database schema generation. | ||
# 'update' will attempt to update the existing schema to match the entities. | ||
quarkus.hibernate-orm.database.generation=update | ||
# In 'dev' profile, drop and recreate the database schema on each startup. | ||
%dev.quarkus.hibernate-orm.database.generation=drop-and-create | ||
# In 'test' profile, drop and recreate the database schema on each startup. | ||
%test.quarkus.hibernate-orm.database.generation=drop-and-create | ||
|
||
# Mail configuration | ||
# Use a mock mailer for development, not sending actual emails. | ||
%dev.quarkus.mailer.mock=true | ||
# In 'prod' profile, disable the mock mailer and send real emails. | ||
%prod.quarkus.mailer.mock=false | ||
|
||
# Zenei Configuration | ||
# Type of database used by the Zenei application. | ||
zenei.database.db-kind=postgresql | ||
# Location of the private key file for JWT signing. | ||
zenei.jwt.private.key.location=dev-private-key.pem | ||
# Location of the public key file for JWT verification. | ||
zenei.jwt.public.key.location=dev-public-key.pem | ||
# Issuer identifier to be included in generated JWTs. | ||
zenei.jwt.issuer=https://example.com/issuer | ||
|
||
# Default zenei admin user | ||
zenei.user.default.admin.username=admin | ||
zenei.user.default.admin.email=[email protected] | ||
zenei.user.default.admin.password=test | ||
zenei.user.default.admin.role=admin | ||
|
||
# Github OAuth | ||
#zenei.external.auth.providers.github.enabled=false | ||
#zenei.external.auth.providers.github.client-id=<YOUR_CLIENT_ID> | ||
#zenei.external.auth.providers.github.client-secret=<YOUR_CLIENT_SECRET> | ||
#zenei.external.auth.providers.github.authorization-uri=https://github.com/login/oauth/authorize | ||
#zenei.external.auth.providers.github.token-uri=https://github.com/login/oauth/access_token | ||
#zenei.external.auth.providers.github.base-uri=https://api.github.com | ||
#zenei.external.auth.providers.github.redirect-uri=http://localhost:8080/external/callback/github | ||
#zenei.external.auth.providers.github.scope=user:email | ||
%dev.quarkus.config.locations=application-common.properties,application-providers.properties,application-dev.properties | ||
%test.quarkus.config.locations=application-common.properties,application-test.properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Generate a development private key | ||
openssl genpkey -algorithm RSA -out core/src/main/resources/dev-private-key.pem -pkeyopt rsa_keygen_bits:2048 | ||
|
||
# Extract the public key from the private key | ||
openssl rsa -in core/src/main/resources/dev-private-key.pem -pubout -out core/src/main/resources/dev-public-key.pem |