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

Beta 1.x.x #2

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d1c861f
fix: cert to keys
ontehfritz Aug 10, 2023
4ac5924
fix: tests and update Auth on docker compose
ontehfritz Aug 14, 2023
607e0d7
chore: update test action
ontehfritz Aug 14, 2023
2621dfb
Merge pull request #1 from lateflip-io/fix-client-for-latest
ontehfritz Aug 14, 2023
a62a966
chore: use github env instead of out-put
ontehfritz Aug 14, 2023
c39cd50
fix: beta build
ontehfritz Aug 14, 2023
8051a4b
chore(release): 1.0.0-beta.3 [skip ci]
semantic-release-bot Aug 14, 2023
346cd51
fix: add enum for supported social providers
ontehfritz Aug 14, 2023
dc2c210
Merge branch 'beta' of https://github.com/lateflip-io/Bulwark.Auth.Gu…
ontehfritz Aug 14, 2023
f0e69d6
chore(release): 1.0.0-beta.4 [skip ci]
semantic-release-bot Aug 14, 2023
2f936d0
chore: do not include symbol package on build
ontehfritz Aug 14, 2023
0e86788
chore: add solution items
ontehfritz Aug 15, 2023
9236544
chore: add base readme.md
ontehfritz Aug 15, 2023
073eb89
chore: update tests for new change email flow
ontehfritz Aug 29, 2023
3633528
Update README.md
ontehfritz Sep 7, 2023
44f0cd5
chore: update docker compose
Sep 9, 2023
9414522
chore: update docker compose file
Dec 11, 2023
59a0f71
chore: update docker compose file
Dec 11, 2023
a330f31
chore: update github action with mongodb replica
Dec 11, 2023
97cff75
fix: upgrade .net
Sep 14, 2024
db6cde5
chore(release): 1.0.0-beta.5 [skip ci]
semantic-release-bot Sep 14, 2024
fffbccd
fix: update nuget info
Sep 14, 2024
eb5e3e4
chore(release): 1.0.0-beta.6 [skip ci]
semantic-release-bot Sep 14, 2024
dbe111e
fix: update nuget readme
Sep 14, 2024
0edaa18
chore(release): 1.0.0-beta.7 [skip ci]
semantic-release-bot Sep 14, 2024
fc509da
fix: update tests correct port binding change in .net 8
Sep 14, 2024
6eae2d7
chore(release): 1.0.0-beta.8 [skip ci]
semantic-release-bot Sep 14, 2024
a3ba2f8
fix: make acknowledge parameters more simple
Sep 23, 2024
1a14a09
chore(release): 1.0.0-beta.9 [skip ci]
semantic-release-bot Sep 23, 2024
dd21cf0
fix: token expired exception for acknowledge
Sep 28, 2024
8c3cfd4
chore(release): 1.0.0-beta.10 [skip ci]
semantic-release-bot Sep 28, 2024
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
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ VERIFICATION_URL=https://localhost:3000/verify
FORGOT_PASSWORD_URL=https://localhost:3000/reset-password
MAGIC_LINK_URL=https://localhost:3000/magic-link
MAGIC_CODE_EXPIRE_IN_MINUTES=10
ACCESS_TOKEN_EXPIRE_IN_MINUTES=5
REFRESH_TOKEN_EXPIRE_IN_HOURS=1
SERVICE_MODE=test
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v2
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Semantic Release
id: release
uses: cycjimmy/semantic-release-action@v3
Expand All @@ -40,5 +40,5 @@ jobs:
if: ${{ steps.release.outputs.new_release_version }}
run: |
dotnet clean
dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --include-symbols --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
dotnet pack ${{ env.PROJECT_PATH }} --configuration Release --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}/*.nupkg -k ${{ secrets.NUGET_TOKEN }} -s ${{ env.NUGET_PUSH_URL }}
59 changes: 59 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Tests

on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
services:
mailhog:
image: mailhog/mailhog:latest
ports:
- 1025:1025
- 8025:8025
bulwark.auth:
image: "latebitflip/bulwark.auth:latest"
env:
DB_CONNECTION: mongodb://localhost:27017
GOOGLE_CLIENT_ID: 651882111548-0hrg7e4o90q1iutmfn02qkf9m90k3d3g.apps.googleusercontent.com
MICROSOFT_CLIENT_ID: 3e3b3b3b-3b3b-3b3b-3b3b-3b3b3b3b3b3b
MICROSOFT_TENANT_ID: 3e3b3b3b-3b3b-3b3b-3b3b-3b3b3b3b3b3b
GITHUB_APP_NAME: latebitflip.io
DOMAIN: latebitflip.io
WEBSITE_NAME: latebitflip.io
EMAIL_TEMPLATE_DIR: src/bulwark-admin-api/email-templates
EMAIL_SEND_ADDRESS: [email protected]
EMAIL_SMTP: true
EMAIL_SMTP_HOST: mailhog
EMAIL_SMTP_PORT: 1025
EMAIL_SMTP_USER: user
EMAIL_SMTP_PASS: pass
EMAIL_SMTP_SECURE: false
VERIFICATION_URL: https://localhost:3000/verify
FORGOT_PASSWORD_URL: https://localhost:3000/reset-password
MAGIC_LINK_URL: https://localhost:3000/magic-link
MAGIC_CODE_EXPIRE_IN_MINUTES: 10
SERVICE_MODE: test
ports:
- 8080:8080
strategy:
matrix:
dotnet-version: ['8.0.x']
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 7
mongodb-replica-set: rs0
mongodb-port: 27017
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
9 changes: 9 additions & 0 deletions Bulwark.Auth.Guard.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{FE243A42-1EE4-4E88-BFEC-C8864948DE10}"
ProjectSection(SolutionItems) = preProject
.github\workflows\release.yaml = .github\workflows\release.yaml
.github\workflows\test.yaml = .github\workflows\test.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3E57E9D0-3C83-435D-A438-0F0C1A8E9720}"
ProjectSection(SolutionItems) = preProject
updateVersion.sh = updateVersion.sh
docker-compose.yaml = docker-compose.yaml
LICENSE = LICENSE
.env = .env
EndProjectSection
EndProject
Global
Expand Down
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

18 changes: 13 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
services:
bulwark.auth:
image: "lateflip/bulwark.auth:1.0.11-beta.2"
image: "latebitflip/bulwark.auth:1.0.0-beta.40"
env_file:
- .env
ports:
- 8080:80
- 8080:8080
depends_on:
- mongodb
- mailhog
mongodb:
image: "mongo:latest"
image: mongo:7
container_name: mongodb
ports:
- 27017:27017
- "27017:27017"
command: mongod --replSet rs0
healthcheck:
test: |
mongosh --eval "try { rs.status().ok } catch (e) { rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: 'localhost:27017' }] }).ok }"
start_period: 0s
interval: 500ms
timeout: 5s
retries: 5
mailhog:
image: "mailhog/mailhog:latest"
ports:
- 1025:1025
- 8025:8025

33 changes: 16 additions & 17 deletions src/Bulwark.Auth.Guard/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ namespace Bulwark.Auth.Guard;
public class Account
{
private readonly RestClient _client;

public Account(string baseUri)
{
_client = new RestClient(baseUri);
_client.AddDefaultHeader("Content-Type", "application/json");
_client.AddDefaultHeader("Accept", "application/json");
}

public Account(RestClient client)
{
_client = client;
}

/// <summary>
/// Creates an account in bulwark-auth, this will send an email to the account
/// email for verification
/// Creates an account in bulwark-auth, this will email the account for verification
/// </summary>
/// <param name="email"></param>
/// <param name="password"></param>
Expand All @@ -49,11 +48,11 @@ public async Task Create(string email,
{
throw new BulwarkException(error.Detail);
}

throw new BulwarkException("Unknown error");
}
}

/// <summary>
/// Delete an account on bulwark-auth, the user must be logged in and send
/// a valid access token to delete the account.
Expand Down Expand Up @@ -85,12 +84,12 @@ public async Task Delete(string email,
{
throw new BulwarkException(error.Detail);
}

throw new BulwarkException("Unknown error");
}
}
}

/// <summary>
/// To verify an account the verification token needs to be verified to activate an account
/// an account is not usable until it is verified
Expand Down Expand Up @@ -120,11 +119,11 @@ public async Task Verify(string email,
{
throw new BulwarkException(error.Detail);
}

throw new BulwarkException("Unknown error");
}
}

/// <summary>
/// This is used to change an email of the account of authenticated
/// account.
Expand Down Expand Up @@ -157,11 +156,11 @@ public async Task Email(string email,
{
throw new BulwarkAccountException(error.Detail);
}

throw new BulwarkException("Unknown error");
}
}

/// <summary>
/// This is used to change an email of authenticated account
/// </summary>
Expand Down Expand Up @@ -193,11 +192,11 @@ public async Task Password(string email,
{
throw new BulwarkException(error.Detail);
}

throw new BulwarkException("Unknown error");
}
}

/// <summary>
/// The email sent out should provide a link to end point that uses
/// this method to change the password
Expand Down Expand Up @@ -230,11 +229,11 @@ public async Task ForgotPassword(string email,
{
throw new BulwarkException(error.Detail);
}

throw new BulwarkException("Unknown error");
}
}

/// <summary>
/// Triggers a forgot password email
/// </summary>
Expand Down
Loading