Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions .docker/dex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Dex

Dex is OIDC provider designed for testing/integration.

## Configuration

The app should be configured with the following parameters:
- Client ID: dex
- Client Secret: dex-secret
- Issuer URL: http://localhost:5556/dex
- The OAuth2 redirect URL should be set to: http://localhost:8080/callback

The OIDC discovery endpoint is:

http://localhost:5556/dex/.well-known/openid-configuration

## Static Users

- User 1:
- Username: user
- Password: password
- Email: user@example.com
- UserID: 1234

## Generation new passwords

Dex requires passwords to be hashed with bcrypt, not plain text.

You can generate your via cli or using online tools like https://bcrypt-generator.com/

```bash
htpasswd -bnBC 10 "" password | tr -d ':\n'
```
26 changes: 26 additions & 0 deletions .docker/dex/dex-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
issuer: http://localhost:5556/dex

storage:
type: memory

enablePasswordDB: true

web:
http: 0.0.0.0:5556

telemetry:
http: 0.0.0.0:5557

staticClients:
- id: dex
redirectURIs:
- 'http://localhost:8080/callback'
- 'http://localhost:8080/api/auth/oidc/callback'
name: 'My Test App'
secret: dex-secret

staticPasswords:
- email: "user@example.com"
hash: "$2a$12$NA7Z4wb9mNc8YGVTJpDm4uWFZfxWRGxEOnO8gq6JcgZ18Qg6YJWVm"
username: "user"
userID: "1234"
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ docker-init:
./.docker/localstack/init-aws.sh
@echo "==> LocalStack successfully initialized"

# Install database schema
install:
@echo "==> Installing database schema..."
go run cmd/*.go --install --yes
@echo "==> Database schema installed successfully"

# Upgrade database schema
upgrade:
@echo "==> Upgrading database schema..."
go run cmd/*.go --upgrade --yes
@echo "==> Database schema upgraded successfully"

# Reset compose
docker-reset: docker-clean docker-up docker-init

Expand Down
Loading