Skip to content

Commit

Permalink
feat: rust implementation and new PKI (#11)
Browse files Browse the repository at this point in the history
This upgrades the basic auth translator to the new
PKI (gRPC) version 2.0.0.

BREAKING CHANGE: This removes the usage of
http requests to the new format of gRPC communication
between PKI and translator.

BREAKING CHANGE: Rename some of the options
due to the fact that rust "clap" default names
some cli options.
  • Loading branch information
buehler committed Apr 30, 2022
1 parent b44e946 commit c370ceb
Show file tree
Hide file tree
Showing 30 changed files with 2,412 additions and 4,333 deletions.
4 changes: 4 additions & 0 deletions .github/fetch_version/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"branches": ["main"],
"plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator"]
}
54 changes: 39 additions & 15 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,48 @@ on:
- main

jobs:
get_next_version:
runs-on: ubuntu-latest
name: Fetch next version number
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: semantic release
id: semantic
uses: cycjimmy/semantic-release-action@v3
with:
dry_run: true
working_directory: .github/fetch_version

- run: echo ${{ steps.semantic.outputs.new_release_version }}
- run: echo ${{ steps.semantic.outputs.new_release_published }}

outputs:
create_release: ${{ steps.semantic.outputs.new_release_published }}
new_version: ${{ steps.semantic.outputs.new_release_version }}

build_images:
needs: get_next_version
if: needs.get_next_version.outputs.create_release == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/exec
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push
id: docker_build
uses: docker/build-push-action@v2
Expand All @@ -35,11 +56,14 @@ jobs:
file: ./Dockerfile
push: true
build-args: |
BUILD_VERSION=${{ env.BUILD_VERSION }}
BUILD_VERSION=${{ needs.get_next_version.outputs.new_version }}
COMMIT_SHA=${{ github.sha }}
tags: |
ghcr.io/wirepact/k8s-keycloak-oidc-translator:latest
ghcr.io/wirepact/k8s-keycloak-oidc-translator:${{ github.sha }}
ghcr.io/wirepact/k8s-keycloak-oidc-translator:${{ env.BUILD_VERSION }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
ghcr.io/wirepact/k8s-token-exchange-translator:latest
ghcr.io/wirepact/k8s-token-exchange-translator:${{ github.sha }}
ghcr.io/wirepact/k8s-token-exchange-translator:${{ needs.get_next_version.outputs.new_version }}
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on:
pull_request:
branches:
- '**'

jobs:
lint_and_test:
name: Linting and Testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- run: rustup component add clippy

- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --no-deps

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- uses: actions-rs/cargo@v1
with:
command: check
23 changes: 4 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

ca.crt
cert.crt
cert.key
/target
*.crt
*.csr
*.key
12 changes: 1 addition & 11 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"publishCmd": "echo \"BUILD_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
}
],
"@semantic-release/github"
]
"plugins": ["@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", "@semantic-release/github"]
}
Loading

0 comments on commit c370ceb

Please sign in to comment.