Skip to content

Commit 4309efb

Browse files
Merge pull request #191 from tazama-lf/dev
feat: Release V2.2.0
2 parents c99cf4a + 7446b6a commit 4309efb

26 files changed

+4509
-2959
lines changed

.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ ACTIVE_CONDITIONS_ONLY=false
3434
# AUTH
3535
AUTHENTICATED=false
3636
CERT_PATH_PUBLIC=
37+
CORS_POLICY=demo
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# This workflow uses actions that are not certified by GitHub.
4+
# They are provided by a third-party and are governed by
5+
# separate terms of service, privacy policy, and support
6+
# documentation.
7+
8+
# GitHub recommends pinning actions to a commit SHA.
9+
# To get a newer version, you will need to update the SHA.
10+
# You can also reference a tag or branch, but the action may change without warning.
11+
12+
# Please do not attempt to edit this flow without the direct consent from the DevOps team. This file is managed centrally.
13+
14+
name: Publish Docker image
15+
16+
on:
17+
push:
18+
branches: [ "dev" ]
19+
20+
jobs:
21+
push_to_registry:
22+
if: github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
23+
name: Push Docker image to Docker Hub
24+
runs-on: ubuntu-latest
25+
permissions:
26+
packages: write
27+
contents: read
28+
attestations: write
29+
id-token: write
30+
steps:
31+
- name: Check out the repo
32+
uses: actions/checkout@v4
33+
34+
- name: Log in to Docker Hub
35+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
36+
with:
37+
username: ${{ secrets.DOCKER_USERNAME }}
38+
password: ${{ secrets.DOCKER_PASSWORD }}
39+
40+
- name: Set ENV variables
41+
run: |
42+
echo "REPO_NAME=${GITHUB_REPOSITORY#$GITHUB_REPOSITORY_OWNER/}" >> $GITHUB_ENV
43+
44+
- name: Use the custom ENV variable
45+
run: |
46+
echo $REPO_NAME
47+
48+
- name: Extract metadata (tags, labels) for Docker
49+
id: meta
50+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
51+
with:
52+
images: tazamaorg/${{ env.REPO_NAME }}
53+
tags: |
54+
type=raw,value=rc
55+
56+
- name: Build and push Docker image
57+
id: push
58+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
59+
with:
60+
context: .
61+
file: ./Dockerfile
62+
push: true
63+
tags: ${{ steps.meta.outputs.tags }}
64+
labels: ${{ steps.meta.outputs.labels }}
65+
build-args: GH_TOKEN=${{ secrets.GH_TOKEN }}
66+
67+
- name: Generate artifact attestation
68+
uses: actions/attest-build-provenance@v1
69+
with:
70+
subject-name: docker.io/tazamaorg/${{ env.REPO_NAME }}
71+
subject-digest: ${{ steps.push.outputs.digest }}
72+
push-to-registry: false
73+
74+
- name: Send Slack Notification
75+
env:
76+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
77+
run: |
78+
curl -X POST -H 'Content-type: application/json' --data '{"blocks": [{"type": "header","text": {"type": "plain_text","text": "New Dockerhub Release Candidate Image published :ship::ship:","emoji": true}},{"type": "section","fields": [{"type": "mrkdwn","text": "*Service:*\n${{ env.REPO_NAME }} "},{"type": "mrkdwn","text": "*Tazama Dockerhub:*\n<https://hub.docker.com/orgs/tazamaorg/repositories>"}]}]}' $SLACK_WEBHOOK_URL

.github/workflows/dockerhub-image-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
images: tazamaorg/${{ env.REPO_NAME }}
5353
tags: |
54-
type=raw,value=2.1.0
54+
type=raw,value=2.2.0
5555
5656
- name: Build and push Docker image
5757
id: push

.prettierrc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"useTabs": false,
55
"semi": true,
66
"singleQuote": true,
7-
"quoteProps": "as-needed",
7+
"quoteProps": "consistent",
88
"trailingComma": "all",
99
"bracketSpacing": true,
10-
"arrowParens": "always"
10+
"arrowParens": "always",
11+
"endOfLine": "lf"
1112
}

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,6 @@ ENV CERT_PATH_PUBLIC=
6969
ENV SIDECAR_HOST=0.0.0.0:5000
7070

7171
ENV ACTIVE_CONDITIONS_ONLY=false
72+
ENV CORS_POLICY=prod
7273

7374
CMD ["build/index.js"]

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Before you start using the Admin API, ensure that you have the following items:
5050

5151
## API Endpoints
5252

53-
### 1. `/v1/admin/reports/getreportbymsgid`
53+
### 1. Get report by message id
5454

5555
#### Description
5656
This endpoint retrieves a report by the specified message ID (`msgid`). The message ID is provided as a query parameter.
@@ -120,7 +120,7 @@ GET /v1/admin/reports/getreportbymsgid?msgid=1234567890 HTTP/1.1
120120
```
121121

122122

123-
### 2.
123+
### 2. Condition Management
124124
##### a. `/v1/admin/event-flow-control/entity`
125125
##### b. `/v1/admin/event-flow-control/account`
126126

@@ -191,13 +191,15 @@ POST, GET, PUT
191191
| `id` | String | Yes | Entity identifier |
192192
| `schmenm` | String | Yes | Scheme name of the entity |
193193
| `synccache` | String | No | Accepts `all`, `active`, `default` or `no` |
194+
| `activeonly` | String | No | Accepts `yes`, or `no` |
194195
#### URL 2 GET METHOD
195196
| Parameter | Type | Required | Description |
196197
|-----------|--------|----------|---------------------------------|
197198
| `id` | String | Yes | Entity ID. |
198199
| `schmenm` | String | Yes | Scheme name of the account |
199200
| `agt` | String | Yes | proprietary agent identifier |
200201
| `synccache` | String | No | Accepts `all`, `active`, `default` or `no` |
202+
| `activeonly` | String | No | Accepts `yes` or `no` |
201203
#### URL 1 PUT METHOD
202204
| Parameter | Type | Required | Description |
203205
|-----------|--------|----------|---------------------------------|

eslint.config.mjs

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
// SPDX-License-Identifier: Apache-2.0
2+
import eslintPluginEslintComments from '@eslint-community/eslint-plugin-eslint-comments';
23
import stylistic from '@stylistic/eslint-plugin';
34
import tsEslint from '@typescript-eslint/eslint-plugin';
45
import tsParser from '@typescript-eslint/parser';
56
import eslintStandard from 'eslint-config-love';
6-
import eslintPluginEslintComments from 'eslint-plugin-eslint-comments';
7+
import eslintConfigPrettier from 'eslint-config-prettier/flat';
8+
import { defineConfig, globalIgnores } from 'eslint/config';
79

8-
export default [
10+
export default defineConfig([
11+
eslintConfigPrettier,
12+
globalIgnores(['**/coverage/**', '**/build/**', '**/node_modules/**', '**/__tests__/**', '*.ts']),
913
{
1014
files: ['**/*.ts'],
1115
plugins: {
1216
...eslintStandard.plugins,
13-
['eslint-comments']: eslintPluginEslintComments,
14-
['@typescript-eslint']: tsEslint,
17+
['@eslint-community/eslint-comments']: eslintPluginEslintComments,
1518
['@stylistic']: stylistic,
19+
['@typescript-eslint']: tsEslint,
1620
},
1721
languageOptions: {
1822
...eslintStandard.languageOptions,
@@ -26,30 +30,37 @@ export default [
2630
rules: {
2731
...eslintStandard.rules,
2832
...eslintPluginEslintComments.configs.recommended.rules,
29-
'eslint-comments/require-description': ['warn', { 'ignore': [] }],
30-
'eslint-comments/disable-enable-pair': 'warn',
31-
'no-console': 'warn',
32-
'@typescript-eslint/restrict-template-expressions': 'error',
33+
'@eslint-community/eslint-comments/require-description': ['error', { ignore: ['eslint-enable'] }],
34+
'@eslint-community/eslint-comments/disable-enable-pair': 'error',
35+
'@typescript-eslint/class-methods-use-this': 'off',
36+
'@typescript-eslint/init-declarations': 'off',
37+
'@typescript-eslint/max-params': ['warn', { max: 5 }],
3338
'@typescript-eslint/no-non-null-assertion': 'off',
34-
'@typescript-eslint/strict-boolean-expressions': 'off',
3539
'@typescript-eslint/no-explicit-any': 'error',
3640
'@typescript-eslint/no-floating-promises': 'off',
41+
'@typescript-eslint/no-magic-numbers': 'warn',
42+
'@typescript-eslint/no-misused-spread': 'off',
3743
'@typescript-eslint/no-var-requires': 'off',
44+
'@typescript-eslint/no-unsafe-type-assertion': 'off',
45+
'@typescript-eslint/no-unnecessary-condition': 'warn',
3846
'@typescript-eslint/no-use-before-define': 'off',
39-
'@typescript-eslint/prefer-optional-chain': 'off',
40-
'@stylistic/indent': ['error', 2],
41-
'@stylistic/semi': ['warn', 'always'],
47+
'@typescript-eslint/prefer-destructuring': 'warn',
48+
'@typescript-eslint/prefer-optional-chain': 'warn',
49+
'@typescript-eslint/restrict-template-expressions': 'error',
50+
'@typescript-eslint/strict-boolean-expressions': 'off',
4251
'@stylistic/quotes': ['error', 'single'],
43-
'@stylistic/quote-props': ['warn', 'as-needed'],
44-
'@stylistic/arrow-parens': ["warn", "always"],
52+
'complexity': ['warn', { max: 25 }],
53+
'max-depth': ['warn', { max: 5 }],
54+
'max-lines': 'off',
55+
'no-console': 'error',
56+
'no-unneeded-ternary': 'off',
57+
/* eslint-comments are bundled with eslint-config-love but they are using the unmaintained plugin. Replaced with @eslint-community/eslint-plugin-eslint-comments */
58+
'eslint-comments/require-description': 'off',
59+
'eslint-comments/disable-enable-pair': 'off',
60+
'eslint-comments/no-aggregating-enable': 'off',
61+
'eslint-comments/no-duplicate-disable': 'off',
62+
'eslint-comments/no-unlimited-disable': 'off',
63+
'eslint-comments/no-unused-enable': 'off',
4564
},
46-
ignores: [
47-
'**/coverage/**',
48-
'**/build/**',
49-
'**/node_modules/**',
50-
'**/__tests__/**',
51-
'**/jest.config.ts',
52-
'**/cluster-setup.ts',
53-
],
54-
}
55-
];
65+
},
66+
]);

0 commit comments

Comments
 (0)