@continuoussecuritytooling/keycloak-reporter 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.ct.yaml +6 -0
  2. package/.github/CONTRIBUTING.md +48 -0
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +34 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
  5. package/.github/PULL_REQUEST_TEMPLATE.md +35 -0
  6. package/.github/workflows/pipeline.yml +52 -5
  7. package/.github/workflows/release.yml +37 -0
  8. package/CHANGELOG.md +22 -0
  9. package/Dockerfile +1 -1
  10. package/README.md +34 -9
  11. package/charts/keycloak-reporter/.helmignore +23 -0
  12. package/charts/keycloak-reporter/Chart.yaml +28 -0
  13. package/charts/keycloak-reporter/README.md +51 -0
  14. package/charts/keycloak-reporter/templates/NOTES.txt +0 -0
  15. package/charts/keycloak-reporter/templates/_helpers.tpl +62 -0
  16. package/charts/keycloak-reporter/templates/cronjob.yaml +66 -0
  17. package/charts/keycloak-reporter/templates/pvc.yaml +15 -0
  18. package/charts/keycloak-reporter/templates/secret.yaml +14 -0
  19. package/charts/keycloak-reporter/templates/serviceaccount.yaml +12 -0
  20. package/charts/keycloak-reporter/values.yaml +78 -0
  21. package/cli.ts +40 -4
  22. package/config/schema.json +8 -0
  23. package/dist/cli.js +31 -5
  24. package/dist/cli.js.map +1 -1
  25. package/dist/config/schema.json +8 -0
  26. package/dist/index.js +0 -0
  27. package/dist/index.js.map +0 -0
  28. package/dist/lib/client.js +0 -0
  29. package/dist/lib/client.js.map +0 -0
  30. package/dist/lib/convert.js +0 -0
  31. package/dist/lib/convert.js.map +0 -0
  32. package/dist/lib/output.js +13 -1
  33. package/dist/lib/output.js.map +1 -1
  34. package/dist/lib/user.js +0 -0
  35. package/dist/lib/user.js.map +0 -0
  36. package/dist/src/cli.js +0 -0
  37. package/dist/src/cli.js.map +0 -0
  38. package/dist/src/config.js +0 -0
  39. package/dist/src/config.js.map +0 -0
  40. package/e2e/spec/clients.js +1 -3
  41. package/e2e/spec/config.js +1 -3
  42. package/e2e/spec/users.js +1 -3
  43. package/e2e/spec/webhooks.js +3 -4
  44. package/jest.config.js +0 -1
  45. package/lib/output.ts +14 -1
  46. package/lintconf.yaml +42 -0
  47. package/package.json +4 -4
  48. package/renovate.json +15 -13
package/.ct.yaml ADDED
@@ -0,0 +1,6 @@
1
+ chart-dirs:
2
+ - charts/keycloak-reporter/
3
+ debug: true
4
+ target-branch: main
5
+ check-version-increment: true
6
+ validate-maintainers: false
@@ -0,0 +1,48 @@
1
+ ### Submitting Pull Requests
2
+
3
+ We'd love for you to contribute to our source code and to make this package even better than it is
4
+ today! Here are the guidelines we'd like you to follow:
5
+
6
+ - [Issues and Bugs](#issue)
7
+ - [Feature Requests](#feature)
8
+ - [Coding Rules](#rules)
9
+ - [Commit Message Guidelines](#commit)
10
+
11
+ ## <a name="issue"></a> Found an Issue?
12
+
13
+ If you find a bug in the source code or a mistake in the documentation, you can help us by
14
+ submitting an issue to our [GitHub Repository][github]. Even better you can submit a Pull Request
15
+ with a fix. But first search if the issue is already described!
16
+
17
+ If not create a new issue:
18
+
19
+ * Tell about your environment:
20
+ * java version
21
+ * used platform and version
22
+ * Describe your issue
23
+ * describe your steps leading to the issue
24
+ * attach error logs or screenshots
25
+ * if possible provide test case or screenshots
26
+
27
+ ## <a name="feature"></a> Want a Feature?
28
+
29
+ You can request a new feature by submitting an issue to our [GitHub Repository][github].
30
+
31
+ Please follow these basic steps to simplify pull request reviews - if you don't you'll probably just be asked to anyway.**
32
+
33
+ * Please rebase your branch against the current develop, use the **develop** for pull requests
34
+ * Please ensure that the test suite passes **and** that code is lint free before submitting a PR by running:
35
+ * ```./mvnw test```
36
+ * If you've added new functionality, **please** include tests which validate its behaviour
37
+ * Make reference to possible [issues](https://github.com/ContinuousSecurityTooling/keycloak-reporter/issues) on PR comment
38
+
39
+ ## <a name="rules"></a> Coding Rules
40
+
41
+ To ensure consistency throughout the source code, keep these rules in mind as you are working:
42
+
43
+ * All features or bug fixes **must be tested** by one or more [specs][unit-testing].
44
+ * All public API methods **must be documented** with jsdoc.
45
+
46
+ ## <a name="commit"></a> Git Commit Guidelines
47
+
48
+ We're using [Angular Commit Guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines)
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+
5
+ ---
6
+ > ℹ Please fill out this template when filing an issue.
7
+ > All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.
8
+ >
9
+ > Per our [*CONTRIBUTING guidelines](https://github.com/ContinuousSecurityTooling/keycloak-auditor/CONTRIBUTING.md), we use GitHub for
10
+ > bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag `angular`.
11
+ >
12
+ > Please remove this line and everything above it before submitting.
13
+
14
+ * [ ] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/ContinuousSecurityTooling/keycloak-auditor/CONTRIBUTING.md).
15
+
16
+ ## What did you do?
17
+
18
+ ℹ Please replace this with what you did.
19
+
20
+ ## What did you expect to happen?
21
+
22
+ ℹ Please replace this with what you expected to happen.
23
+
24
+ ## What happened instead?
25
+
26
+ ℹ Please replace this with of what happened instead.
27
+
28
+ ## Your Environment
29
+
30
+ **Java version:**
31
+
32
+ ## Demo Project
33
+
34
+ ℹ Please link to or upload a project we can download that reproduces the issue.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+
5
+ ---
6
+
7
+ ## Prerequisites
8
+
9
+ Please answer the following questions for yourself before submitting an issue.
10
+
11
+ * [ ] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/ContinuousSecurityTooling/keycloak-auditor/CONTRIBUTING.md).
12
+
13
+ ## Changes
14
+
15
+ **Is your feature request related to a problem? Please describe.**
16
+ <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
17
+
18
+ **Describe the solution you'd like**
19
+ <!-- A clear and concise description of what you want to happen. -->
20
+
21
+ **Describe alternatives you've considered**
22
+ <!-- A clear and concise description of any alternative solutions or features you've considered. -->
23
+
24
+ **Additional context**
25
+ <!-- Add any other context or screenshots about the feature request here. -->
@@ -0,0 +1,35 @@
1
+ ## :memo: Description
2
+
3
+ <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->
4
+
5
+ ### :dart: Relevant issues
6
+ <!-- Please add relevant opened issues -->
7
+
8
+ ### :gem: Type of change
9
+
10
+ <!-- Please delete options that are not relevant. -->
11
+
12
+ - [ ] Bug fix (non-breaking change which fixes an issue)
13
+ - [ ] New feature (non-breaking change which adds functionality)
14
+ - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
15
+ - [ ] This change requires a documentation update
16
+
17
+ ### :scroll: Example code
18
+ ```js
19
+
20
+ ```
21
+
22
+ ## :vertical_traffic_light: How Has This Been Tested?
23
+
24
+ Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
25
+
26
+ - [ ] Test A
27
+ - [ ] Test B
28
+
29
+ ## :checkered_flag: Checklist:
30
+
31
+ - [ ] My code follows the style guidelines of this project
32
+ - [ ] I have performed a self-review of my own code
33
+ - [ ] **I have added tests that prove my fix is effective or that my feature works**
34
+ - [ ] **New and existing unit tests pass locally with my changes**
35
+ - [ ] I have commented my code, particularly in hard-to-understand areas
@@ -1,6 +1,9 @@
1
1
  name: Build
2
- "on":
3
- - push
2
+
3
+ on:
4
+ merge_group:
5
+ push:
6
+
4
7
  jobs:
5
8
  build:
6
9
  name: "Build and Test on Node ${{ matrix.node_version }} and ${{ matrix.os }}"
@@ -16,7 +19,7 @@ jobs:
16
19
  - macOS-latest
17
20
  - windows-latest
18
21
  steps:
19
- - uses: actions/checkout@v3
22
+ - uses: actions/checkout@v4
20
23
  - name: "Use Node.js ${{ matrix.node_version }}"
21
24
  uses: actions/setup-node@v3
22
25
  with:
@@ -27,6 +30,49 @@ jobs:
27
30
  npm run build
28
31
  npm run test
29
32
 
33
+ chart:
34
+ name: "Build and Test Helm Chart"
35
+ runs-on: ubuntu-latest
36
+
37
+ steps:
38
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
39
+ - uses: actions/checkout@v4
40
+ with:
41
+ fetch-depth: 0
42
+
43
+ - name: Set up Helm
44
+ uses: azure/setup-helm@v3
45
+ with:
46
+ version: v3.11.2
47
+
48
+ - uses: actions/setup-python@v4
49
+ with:
50
+ python-version: '3.9'
51
+ check-latest: true
52
+
53
+ - name: Helm Chart Testing
54
+ uses: helm/chart-testing-action@v2.4.0
55
+
56
+ - name: Run chart-testing (list-changed)
57
+ id: list-changed
58
+ run: |
59
+ changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
60
+ if [[ -n "$changed" ]]; then
61
+ echo "changed=true" >> "$GITHUB_OUTPUT"
62
+ fi
63
+
64
+ - name: Run chart-testing (lint)
65
+ if: steps.list-changed.outputs.changed == 'true'
66
+ run: ct lint --target-branch ${{ github.event.repository.default_branch }} --check-version-increment false
67
+
68
+ - name: Create kind cluster
69
+ if: steps.list-changed.outputs.changed == 'true'
70
+ uses: helm/kind-action@v1.8.0
71
+
72
+ - name: Run chart-testing (install)
73
+ if: steps.list-changed.outputs.changed == 'true'
74
+ run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "--set 'keycloak.config.url=http://localhost:8080' --set 'keycloak.config.url=http://localhost:8080' --set 'keycloak.config.clientId=clientId' --set 'keycloak.config.clientSecret=clientSecret' --set 'keycloak.config.webhookType=test' --set 'keycloak.config.webhookUrl=http://localhost:8888'"
75
+
30
76
  - uses: actions/upload-artifact@v3
31
77
  with:
32
78
  name: dist-folder
@@ -37,6 +83,7 @@ jobs:
37
83
  runs-on: "${{ matrix.os }}"
38
84
  needs:
39
85
  - build
86
+ - chart
40
87
  strategy:
41
88
  matrix:
42
89
  node_version:
@@ -47,7 +94,7 @@ jobs:
47
94
  os:
48
95
  - ubuntu-latest
49
96
  steps:
50
- - uses: actions/checkout@v3
97
+ - uses: actions/checkout@v4
51
98
  - name: "Use Node.js ${{ matrix.node_version }}"
52
99
  uses: actions/setup-node@v3
53
100
  with:
@@ -75,7 +122,7 @@ jobs:
75
122
  needs:
76
123
  - end2end
77
124
  steps:
78
- - uses: actions/checkout@v3
125
+ - uses: actions/checkout@v4
79
126
  - uses: actions/setup-node@v3
80
127
  # TODO: Support Node 16+
81
128
  with:
@@ -0,0 +1,37 @@
1
+ name: Release Chart
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ release:
10
+ # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
11
+ # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
12
+ permissions:
13
+ contents: write
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v4
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Configure Git
22
+ run: |
23
+ git config user.name "$GITHUB_ACTOR"
24
+ git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
25
+
26
+ - name: Install Helm
27
+ uses: azure/setup-helm@v3
28
+
29
+ - name: Run chart-testing (lint)
30
+ run: ct lint --target-branch
31
+
32
+ - name: Run chart-releaser
33
+ uses: helm/chart-releaser-action@v1.5.0
34
+ with:
35
+ charts_dir: charts/
36
+ env:
37
+ CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
package/CHANGELOG.md ADDED
@@ -0,0 +1,22 @@
1
+ # 0.2.0 (2023-06-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @json2csv/node to v7 ([42934da](https://github.com/ContinuousSecurityTooling/[object Object]/commit/42934da57a546b1a0db324183b3db51c27ff1cc2))
7
+ * **deps:** update dependency @json2csv/node to v7.0.1 ([b0aeb36](https://github.com/ContinuousSecurityTooling/[object Object]/commit/b0aeb366b07a38d8b648b4a0c763bab578db653a))
8
+ * Stick to NodeJS 16 ([595d799](https://github.com/ContinuousSecurityTooling/[object Object]/commit/595d799510e81de885430d7cc62549dd8a272aee))
9
+
10
+
11
+ ### Features
12
+
13
+ * **Config:** Provide config file functionality ([f9097f9](https://github.com/ContinuousSecurityTooling/[object Object]/commit/f9097f966c2dfc5240111e9294742ad3821c36ad))
14
+ * **Config:** Use config file in helm chart ([21e0512](https://github.com/ContinuousSecurityTooling/[object Object]/commit/21e051243df1a3000d2b57f6ee0feab5f6314910))
15
+ * **Helm:** Initial chart version ([401c740](https://github.com/ContinuousSecurityTooling/[object Object]/commit/401c7401b1b34b479bb5a370c9d1077a36f653b0)), closes [#1](https://github.com/ContinuousSecurityTooling/[object Object]/issues/1)
16
+ * **Report:** Adding id to report ([8dbc3d4](https://github.com/ContinuousSecurityTooling/[object Object]/commit/8dbc3d4deacba0a5e1729da93b8d933557ebd45b))
17
+ * **Testing:** Adding end2end testing via keycloak local ([036202f](https://github.com/ContinuousSecurityTooling/[object Object]/commit/036202f47324e8b3e40764fdc3a43a270a2687cf))
18
+ * **Users:** Adding user and client listing functionality ([4c13fa0](https://github.com/ContinuousSecurityTooling/[object Object]/commit/4c13fa0642d75b8e229091aca052a83fa8c7eb32))
19
+ * **Webhooks:** Adding Support for Teams and Slack ([66da168](https://github.com/ContinuousSecurityTooling/[object Object]/commit/66da168d2cd234ebc6dd961cfe62a3c8191c0ccc)), closes [#2](https://github.com/ContinuousSecurityTooling/[object Object]/issues/2)
20
+
21
+
22
+
package/Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM node:16
2
2
 
3
3
  ENV CONFIG_FILE=/app/config.json
4
4
 
5
- COPY dist/ docker_entrypoint.sh /app
5
+ COPY dist/ docker_entrypoint.sh package.json /app
6
6
 
7
7
  WORKDIR /app
8
8
 
package/README.md CHANGED
@@ -24,14 +24,31 @@ kc-reporter listClients <Keycloak_Root_URL> <Client_ID> <Client_Secret> --format
24
24
 
25
25
  The output looks for CSV, like that:
26
26
  ```
27
- "client","description","realm","enabled","public","allowedOrigins"
28
- "account",,"bunge",true,true,"[]"
29
- "account-console",,"bunge",true,true,"[]"
30
- "admin-cli",,"bunge",true,true,"[]"
31
- "broker",,"bunge",true,false,"[]"
32
- "portal",,"bunge",true,false,"[]"
33
- "realm-management",,"bunge",true,false,"[]"
34
- "security-admin-console",,"bunge",true,true,"[""+""]"
27
+ "client","id","description","realm","enabled","public","allowedOrigins"
28
+ "account","d192964b-189e-499b-ada4-b82b37b9cc50",,"master",true,false,"[]"
29
+ "account-console","f8ca4598-0335-445c-992e-fed749ff464a",,"master",true,true,"[]"
30
+ "admin-cli","615cbe43-0747-4273-8bc4-b7897a27ce39",,"master",true,true,"[]"
31
+ "broker","3e3a17c4-37d4-4a66-bb59-0ddd1b0fa4f6",,"master",true,false,"[]"
32
+ "keycloak-reporter","363bd6ed-e0fc-48f6-b896-27d9b16be42a","","master",true,false,"["""",""+""]"
33
+ "master-realm","5d822cd2-2583-4d45-ae33-c85ebd6099fa",,"master",true,false,"[]"
34
+ "nodejs-test-realm","6b6c26e7-175a-45df-a919-de51ca4f4523",,"master",true,false,"[]"
35
+ "security-admin-console","239fca1d-e027-4d3b-9814-3b517272cb80",,"master",true,true,"[""+""]"
36
+ "tokenRealmTest-realm","10f8398f-44a5-4f4b-9efb-6a0c4b79af66",,"master",true,false,"[]"
37
+ "account","bdf23b22-5abb-4823-aa76-9d21216d7143",,"nodejs-test",true,false,"[]"
38
+ "account-console","7eb727fb-18d2-482b-8e34-8982a4efffc3",,"nodejs-test",true,true,"[]"
39
+ "admin-cli","99aeb26e-222d-4195-a5e8-f2f94db12b83",,"nodejs-test",true,true,"[]"
40
+ "broker","6f3a7144-872e-415b-ab9a-d5a66a3f2951",,"nodejs-test",true,false,"[]"
41
+ "confidential-client","d0650a93-8fe2-4524-8020-4531b6276230",,"nodejs-test",true,false,"[""http://localhost/confidential-client""]"
42
+ "public-client","c2bd2473-f46c-4c51-af36-b40bef9bb644",,"nodejs-test",true,true,"[]"
43
+ "realm-management","49fd4151-3d49-4d10-968b-841123831399",,"nodejs-test",true,false,"[]"
44
+ "security-admin-console","ed86e5ed-ced1-435c-b62b-632fe545359c",,"nodejs-test",true,true,"[""+""]"
45
+ "account","0a57c891-1d38-4782-badf-a68140a8cf76",,"tokenRealmTest",true,true,"[]"
46
+ "account-console","977ac593-4fc7-4a69-94f4-d5e88cd563e9",,"tokenRealmTest",true,true,"[]"
47
+ "admin-cli","50ada8d5-bd5e-4182-b6c5-dd4ec5c280b6",,"tokenRealmTest",true,true,"[]"
48
+ "broker","91ea3c53-9583-40f6-b3ef-e7bfa28a8385",,"tokenRealmTest",true,false,"[]"
49
+ "customer-portal","491ff0ea-51e1-41df-8ee2-2865537da924",,"tokenRealmTest",true,false,"[]"
50
+ "realm-management","8dec327b-c120-436d-a27a-bed9494962cd",,"tokenRealmTest",true,false,"[]"
51
+ "security-admin-console","a136d00b-119b-4fda-a203-2b946add9b4b",,"tokenRealmTest",true,true,"[""+""]"
35
52
  ```
36
53
 
37
54
  Valid commands are:
@@ -40,11 +57,19 @@ Valid commands are:
40
57
 
41
58
  ## Advanced
42
59
 
60
+
61
+ ### Helm
62
+ ~
63
+
64
+ helm repo add cloud-tooling https://cloudtooling.github.io/helm-charts/
65
+
66
+ cloud-tooling/keycloak-reporter
67
+
43
68
  ### Config file
44
69
 
45
70
  You can also provider a config file via env var `CONFIG_FILE` and then just provide the commands, e.g.:
46
71
  ```
47
- CONFIG_FILE=e2e/fixtures/config.json kc-reporter listClients
72
+ CONFIG_FILE==$(pwd)/e2e/fixtures/config.json kc-reporter listClients
48
73
  ```
49
74
 
50
75
  ### Post to Slack or Teams
@@ -0,0 +1,23 @@
1
+ # Patterns to ignore when building packages.
2
+ # This supports shell glob matching, relative path matching, and
3
+ # negation (prefixed with !). Only one pattern per line.
4
+ .DS_Store
5
+ # Common VCS dirs
6
+ .git/
7
+ .gitignore
8
+ .bzr/
9
+ .bzrignore
10
+ .hg/
11
+ .hgignore
12
+ .svn/
13
+ # Common backup files
14
+ *.swp
15
+ *.bak
16
+ *.tmp
17
+ *.orig
18
+ *~
19
+ # Various IDEs
20
+ .project
21
+ .idea/
22
+ *.tmproj
23
+ .vscode/
@@ -0,0 +1,28 @@
1
+ apiVersion: v2
2
+ name: keycloak-reporter
3
+ description: A Helm chart for Kubernetes
4
+
5
+ # A chart can be either an 'application' or a 'library' chart.
6
+ #
7
+ # Application charts are a collection of templates that can be packaged into versioned archives
8
+ # to be deployed.
9
+ #
10
+ # Library charts provide useful utilities or functions for the chart developer. They're included as
11
+ # a dependency of application charts to inject those utilities and functions into the rendering
12
+ # pipeline. Library charts do not define any templates and therefore cannot be deployed.
13
+ type: application
14
+
15
+ # This is the chart version. This version number should be incremented each time you make changes
16
+ # to the chart and its templates, including the app version.
17
+ # Versions are expected to follow Semantic Versioning (https://semver.org/)
18
+ version: 0.4.1
19
+
20
+ # This is the version number of the application being deployed. This version number should be
21
+ # incremented each time you make changes to the application. Versions are not expected to
22
+ # follow Semantic Versioning. They should reflect the version the application is using.
23
+ # It is recommended to use it with quotes.
24
+ appVersion: "0.2.0"
25
+ maintainers:
26
+ # Martin Reinhardt
27
+ - name: hypery2k
28
+ email: martin@m13t.de
@@ -0,0 +1,51 @@
1
+ # keycloak-reporter
2
+
3
+ ![Version: 0.4.1](https://img.shields.io/badge/Version-0.4.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.2.0](https://img.shields.io/badge/AppVersion-0.2.0-informational?style=flat-square)
4
+
5
+ A Helm chart for Kubernetes
6
+
7
+ ## Maintainers
8
+
9
+ | Name | Email | Url |
10
+ | ---- | ------ | --- |
11
+ | hypery2k | <martin@m13t.de> | |
12
+
13
+ ## Values
14
+
15
+ | Key | Type | Default | Description |
16
+ |-----|------|---------|-------------|
17
+ | affinity | object | `{}` | |
18
+ | cronjobs[0].name | string | `"clients"` | |
19
+ | cronjobs[0].schedule | string | `"0 0 1 */3 *"` | |
20
+ | cronjobs[0].script | string | `"/app/index.js listClients"` | |
21
+ | cronjobs[1].name | string | `"users"` | |
22
+ | cronjobs[1].schedule | string | `"0 0 1 */3 *"` | |
23
+ | cronjobs[1].script | string | `"/app/index.js listUsers"` | |
24
+ | env | object | `{}` | |
25
+ | fullnameOverride | string | `""` | |
26
+ | image.pullPolicy | string | `"IfNotPresent"` | |
27
+ | image.repository | string | `"continuoussecuritytooling/keycloak-reporting-cli"` | |
28
+ | image.tag | string | `"latest"` | |
29
+ | imagePullSecrets | list | `[]` | |
30
+ | keycloak.config.clientId | string | `""` | |
31
+ | keycloak.config.clientSecret | string | `""` | |
32
+ | keycloak.config.output | string | `"webhook"` | |
33
+ | keycloak.config.url | string | `""` | |
34
+ | keycloak.config.webhookMessage | string | `""` | |
35
+ | keycloak.config.webhookType | string | `""` | |
36
+ | keycloak.config.webhookUrl | string | `""` | |
37
+ | keycloak.volumes.reports | string | `""` | |
38
+ | nameOverride | string | `""` | |
39
+ | nodeSelector | object | `{}` | |
40
+ | podAnnotations | object | `{}` | |
41
+ | podSecurityContext | object | `{}` | |
42
+ | replicaCount | int | `1` | |
43
+ | resources | object | `{}` | |
44
+ | securityContext | object | `{}` | |
45
+ | serviceAccount.annotations | object | `{}` | |
46
+ | serviceAccount.create | bool | `true` | |
47
+ | serviceAccount.name | string | `""` | |
48
+ | tolerations | list | `[]` | |
49
+
50
+ ----------------------------------------------
51
+ Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
File without changes
@@ -0,0 +1,62 @@
1
+ {{/*
2
+ Expand the name of the chart.
3
+ */}}
4
+ {{- define "keycloak-reporter.name" -}}
5
+ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6
+ {{- end }}
7
+
8
+ {{/*
9
+ Create a default fully qualified app name.
10
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11
+ If release name contains chart name it will be used as a full name.
12
+ */}}
13
+ {{- define "keycloak-reporter.fullname" -}}
14
+ {{- if .Values.fullnameOverride }}
15
+ {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16
+ {{- else }}
17
+ {{- $name := default .Chart.Name .Values.nameOverride }}
18
+ {{- if contains $name .Release.Name }}
19
+ {{- .Release.Name | trunc 63 | trimSuffix "-" }}
20
+ {{- else }}
21
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22
+ {{- end }}
23
+ {{- end }}
24
+ {{- end }}
25
+
26
+ {{/*
27
+ Create chart name and version as used by the chart label.
28
+ */}}
29
+ {{- define "keycloak-reporter.chart" -}}
30
+ {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31
+ {{- end }}
32
+
33
+ {{/*
34
+ Common labels
35
+ */}}
36
+ {{- define "keycloak-reporter.labels" -}}
37
+ helm.sh/chart: {{ include "keycloak-reporter.chart" . }}
38
+ {{ include "keycloak-reporter.selectorLabels" . }}
39
+ {{- if .Chart.AppVersion }}
40
+ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41
+ {{- end }}
42
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
43
+ {{- end }}
44
+
45
+ {{/*
46
+ Selector labels
47
+ */}}
48
+ {{- define "keycloak-reporter.selectorLabels" -}}
49
+ app.kubernetes.io/name: {{ include "keycloak-reporter.name" . }}
50
+ app.kubernetes.io/instance: {{ .Release.Name }}
51
+ {{- end }}
52
+
53
+ {{/*
54
+ Create the name of the service account to use
55
+ */}}
56
+ {{- define "keycloak-reporter.serviceAccountName" -}}
57
+ {{- if .Values.serviceAccount.create }}
58
+ {{- default (include "keycloak-reporter.fullname" .) .Values.serviceAccount.name }}
59
+ {{- else }}
60
+ {{- default "default" .Values.serviceAccount.name }}
61
+ {{- end }}
62
+ {{- end }}
@@ -0,0 +1,66 @@
1
+ {{- $fullName := include "keycloak-reporter.fullname" . -}}
2
+ {{- range .Values.cronjobs }}
3
+ apiVersion: batch/v1
4
+ kind: CronJob
5
+ metadata:
6
+ name: {{ printf "%s-job-%s" $fullName .name }}
7
+ spec:
8
+ schedule: "{{ .schedule }}"
9
+ jobTemplate:
10
+ spec:
11
+ template:
12
+ {{- with $.Values.podAnnotations }}
13
+ annotations:
14
+ {{- toYaml . | nindent 8 }}
15
+ {{- end }}
16
+ spec:
17
+ {{- with $.Values.imagePullSecrets }}
18
+ imagePullSecrets:
19
+ {{- toYaml . | nindent 8 }}
20
+ {{- end }}
21
+ containers:
22
+ - name: {{ .name }}
23
+ image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
24
+ imagePullPolicy: {{ $.Values.image.pullPolicy }}
25
+ command:
26
+ - /bin/sh
27
+ - -c
28
+ - {{ .script }}
29
+ env:
30
+ - name: CONFIG_FILE
31
+ value: "/app/config.json"
32
+ {{- with $.Values.env }}
33
+ {{- tpl (toYaml .) $ | nindent 12 }}
34
+ {{- end }}
35
+ volumeMounts:
36
+ - name: config-file
37
+ mountPath: "/app/config.json"
38
+ readOnly: true
39
+ {{- if ($.Values.keycloak.config.volumes).reports }}
40
+ - name: reports-dir
41
+ mountPath: "/app/reports"
42
+ {{- end }}
43
+ restartPolicy: OnFailure
44
+ {{- if $.Values.resources }}
45
+ resources:
46
+ {{ toYaml $.Values.resources }}
47
+ {{- end }}
48
+ {{- if $.Values.nodeSelector }}
49
+ nodeSelector:
50
+ {{ toYaml $.Values.nodeSelector | indent 12 }}
51
+ {{- end }}
52
+ {{- if $.Values.tolerations }}
53
+ tolerations:
54
+ {{ toYaml $.Values.tolerations | indent 12 }}
55
+ {{- end }}
56
+ volumes:
57
+ - name: config-file
58
+ secret:
59
+ secretName: {{ $fullName }}
60
+ {{- if ($.Values.keycloak.config.volumes).reports }}
61
+ - name: reports-dir
62
+ persistentVolumeClaim:
63
+ claimName: {{ $fullName }}-reports
64
+ {{- end }}
65
+ ---
66
+ {{- end -}}
@@ -0,0 +1,15 @@
1
+ {{- $fullName := include "keycloak-reporter.fullname" . -}}
2
+ {{- if (.Values.keycloak.config.volumes).reports }}
3
+ apiVersion: v1
4
+ kind: PersistentVolumeClaim
5
+ metadata:
6
+ name: {{ $fullName }}-reports
7
+ annotations: {{ .Values.keycloak.config.volumes.reports.annotations }}
8
+ spec:
9
+ accessModes:
10
+ - ReadWriteMany
11
+ storageClassName: {{ .Values.keycloak.config.volumes.reports.storageClassName }}
12
+ resources:
13
+ requests:
14
+ storage: {{ .Values.keycloak.config.volumes.reports.volumeSize }}
15
+ {{- end }}
@@ -0,0 +1,14 @@
1
+ {{- $fullName := include "keycloak-reporter.fullname" . -}}
2
+ apiVersion: v1
3
+ kind: Secret
4
+ metadata:
5
+ name: {{ $fullName }}
6
+ stringData:
7
+ {{- range $k, $v := .Values.keycloak.config }}
8
+ {{- if $v}}
9
+ {{ $k }}: {{ $v }}
10
+ {{- end }}
11
+ {{- end }}
12
+ {{- if (.Values.keycloak.config.volumes).reports }}
13
+ reports: /app/reports
14
+ {{- end }}
@@ -0,0 +1,12 @@
1
+ {{- if .Values.serviceAccount.create -}}
2
+ apiVersion: v1
3
+ kind: ServiceAccount
4
+ metadata:
5
+ name: {{ include "keycloak-reporter.serviceAccountName" . }}
6
+ labels:
7
+ {{- include "keycloak-reporter.labels" . | nindent 4 }}
8
+ {{- with .Values.serviceAccount.annotations }}
9
+ annotations:
10
+ {{- toYaml . | nindent 4 }}
11
+ {{- end }}
12
+ {{- end }}