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

feat(oidc_auth): Add backend support for OIDC Auth #94

Merged
merged 1 commit into from
Jan 16, 2025
Merged
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
27 changes: 26 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,29 @@
TOKEN_HOUR_LIFESPAN=24
# Secret key to sign tokens (openssl rand -hex 32)
API_SECRET=some-random-string
READ_API_AUTHENTICATION_ENABLED=false
READ_API_AUTHENTICATION_ENABLED=false

PORT=8080

# OIDC Provider (To be set if OIDC Authentication support required)
# The URL for retrieving keys for Token Parsing
JWKS_URI=https://provider/keys

# The field in ID Token that is to be used as username
OIDC_USERNAME_KEY=employee_id

# The field in ID Token that is to be used as email
OIDC_EMAIL_KEY=mail

# The issuer url
OIDC_ISSUER=https://provider

# The field in ID Token that is used as display name
OIDC_DISPLAYNAME_KEY=display_name

# Some OIDC providers do not provide the "alg" header in their key set(ex. AzureAD)
# This env variable, if set, will be used for signing while verifying the JWT signature
# (Make sure it's same as the signing algorithm used by the provider)
#
# For OIDC providers that provide the "alg" header in their key set, there is no need for this to be set
OIDC_SIGNING_ALG=RS256
4 changes: 2 additions & 2 deletions .github/workflows/api-swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: '1.20'
go-version: '1.22'
check-latest: true
cache: true

- name: Code Generation
run: cp external_ref_fields.example.yaml external_ref_fields.yaml && go generate ./...

- name: lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.55
version: v1.62.2

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2024 Kaushlendra Pratap <[email protected]>
# SPDX-License-Identifier: GPL-2.0-only
FROM golang:1.20 AS build
FROM golang:1.22 AS build

WORKDIR /LicenseDb

Expand Down
Loading
Loading