Skip to content

Commit f626786

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 0b44d82 + 7a4beff commit f626786

16 files changed

Lines changed: 974 additions & 397 deletions

.github/workflows/codeql-analysis.yml

Lines changed: 61 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,63 +9,84 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: "CodeQL Advanced"
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: ["main"]
1717
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ main ]
18+
branches: ["main"]
2019
schedule:
21-
- cron: '15 16 * * 1'
20+
- cron: "15 16 * * 1"
2221

2322
jobs:
2423
analyze:
25-
name: Analyze
26-
runs-on: ubuntu-latest
24+
name: Analyze (${{ matrix.language }})
25+
# Runner size impacts CodeQL analysis time. To learn more, please see:
26+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27+
# - https://gh.io/supported-runners-and-hardware-resources
28+
# - https://gh.io/using-larger-runners (GitHub.com only)
29+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
30+
runs-on: ${{ 'ubuntu-latest' }}
2731
permissions:
32+
# required for all workflows
33+
security-events: write
34+
35+
# required to fetch internal or private CodeQL packs
36+
packages: read
37+
38+
# only required for workflows in private repositories
2839
actions: read
2940
contents: read
30-
security-events: write
3141

3242
strategy:
3343
fail-fast: false
3444
matrix:
35-
language: [ 'go' ]
36-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37-
# Learn more:
38-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39-
45+
include:
46+
- language: go
47+
build-mode: autobuild
48+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
49+
# Use `c-cpp` to analyze code written in C, C++ or both
50+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
4056
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v2
43-
44-
# Initializes the CodeQL tools for scanning.
45-
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
47-
with:
48-
languages: ${{ matrix.language }}
49-
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
51-
# Prefix the list here with "+" to use these queries and those in the config file.
52-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
53-
54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
5859

59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
60+
# Initializes the CodeQL tools for scanning.
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v3
63+
with:
64+
languages: ${{ matrix.language }}
65+
build-mode: ${{ matrix.build-mode }}
66+
# If you wish to specify custom queries, you can do so here or in a config file.
67+
# By default, queries listed here will override any specified in a config file.
68+
# Prefix the list here with "+" to use these queries and those in the config file.
6169

62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
70+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71+
# queries: security-extended,security-and-quality
6572

66-
#- run: |
67-
# make bootstrap
68-
# make release
73+
# If the analyze step fails for one of the languages you are analyzing with
74+
# "We were unable to automatically build your code", modify the matrix above
75+
# to set the build mode to "manual" for that language. Then modify this step
76+
# to build your code.
77+
# ℹ️ Command-line programs to run using the OS shell.
78+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
- if: matrix.build-mode == 'manual'
80+
shell: bash
81+
run: |
82+
echo 'If you are using a "manual" build mode for one or more of the' \
83+
'languages you are analyzing, replace this with the commands to build' \
84+
'your code, for example:'
85+
echo ' make bootstrap'
86+
echo ' make release'
87+
exit 1
6988
70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@v3
91+
with:
92+
category: "/language:${{matrix.language}}"

.github/workflows/go.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Setup Go environment
10-
uses: actions/setup-go@v3.0.0
10+
uses: actions/setup-go@v5.0.2
1111
with:
12-
go-version: 1.19
12+
go-version: 1.23
1313
- name: Checkout code
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v4.1.7
1515
- name: Run golangci-lint
16-
uses: golangci/golangci-lint-action@v3.1.0
16+
uses: golangci/golangci-lint-action@v6.1.0
1717
- name: WriteGoList
1818
run: go list -json -m all > go.list
1919
- name: nancy
@@ -33,14 +33,14 @@ jobs:
3333
docker ps
3434
docker logs keycloak
3535
- name: CodeCov
36-
uses: codecov/codecov-action@v1
36+
uses: codecov/codecov-action@v4.5.0
3737
with:
3838
file: ./coverage.txt
3939

4040
# Publish benchmarks for the main branch only
4141
- name: Store Benchmark Result
4242
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
43-
uses: rhysd/github-action-benchmark@v1
43+
uses: rhysd/github-action-benchmark@v1.20.3
4444
with:
4545
# What benchmark tool the output.txt came from
4646
tool: "go"

.golangci.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
run:
2-
skip-dirs:
3-
- (^|/)testdata($|/)
4-
skip-dirs-use-default: false
5-
61
linters:
72
enable:
83
- goimports
@@ -18,10 +13,6 @@ linters:
1813
linters-settings:
1914
misspell:
2015
locale: US
21-
golint:
22-
min-confidence: 0
23-
govet:
24-
check-shadowing: false
2516
goimports:
2617
local-prefixes: github.com/Nerzal/gocloak
2718
gocognit:
@@ -32,6 +23,9 @@ linters-settings:
3223
simplify: true
3324

3425
issues:
26+
exclude-dirs:
27+
- (^|/)testdata($|/)
28+
exclude-dirs-use-default: false
3529
exclude-use-default: false
3630
exclude-rules:
3731
- path: _test\.go

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
FROM quay.io/keycloak/keycloak:24.0.3
1+
FROM quay.io/keycloak/keycloak:26.5.1
22
COPY testdata data/import
33
WORKDIR /opt/keycloak
44
ENV KC_HOSTNAME=localhost
55
ENV KEYCLOAK_USER=admin
66
ENV KEYCLOAK_PASSWORD=secret
77
ENV KEYCLOAK_ADMIN=admin
88
ENV KEYCLOAK_ADMIN_PASSWORD=secret
9-
ENV KC_FEATURES=account-api,account2,authorization,client-policies,impersonation,docker,scripts,admin-fine-grained-authz
9+
ENV KC_HEALTH_ENABLED=true
10+
ENV KC_FEATURES=account-api,account3,authorization,client-policies,impersonation,docker,scripts,admin-fine-grained-authz
1011
RUN /opt/keycloak/bin/kc.sh import --file /data/import/gocloak-realm.json
1112
ENTRYPOINT ["/opt/keycloak/bin/kc.sh"]

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ test:
22
./run-tests.sh
33

44
start-keycloak: stop-keycloak
5-
docker-compose up -d
5+
docker compose up -d
66

77
stop-keycloak:
8-
docker-compose down
8+
docker compose down
9+
10+
generate-gocloak-interface:
11+
@echo "Remember to: go install github.com/vburenin/ifacemaker@latest"
12+
@$(shell go env GOPATH)/bin/ifacemaker -f client.go -s GoCloak -i GoCloakIface -p gocloak -o gocloak_iface.go

0 commit comments

Comments
 (0)