Skip to content

Commit

Permalink
chore: merge develop into main (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
soleksy-splunk authored Oct 2, 2024
2 parents 7f744b2 + bdfa8c3 commit 69c02a6
Show file tree
Hide file tree
Showing 206 changed files with 7,587 additions and 3,673 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/automatic_doc_generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Automatic doc generation"
on:
workflow_call:
inputs:
python-version:
required: true
type: string

jobs:
generate-docs:
runs-on: ubuntu-latest
env:
isPR: ${{ github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'main' }}
steps:
- uses: actions/checkout@v4
with:
lfs: true
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Generate docs
run: |
poetry run ucc-gen-docs
- name: Importing GPG key
if: ${{ env.isPR }}
uses: crazy-max/ghaction-import-gpg@v6
with:
git_committer_name: ${{ secrets.SA_GH_USER_NAME }}
git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }}
gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.SA_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Push updated screenshots
if: ${{ env.isPR }}
run: |
git add \*.md
git diff --staged --exit-code || (git commit -S -m "doc: updated docs regarding generated conf, xml and html files" && git push)
11 changes: 10 additions & 1 deletion .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ jobs:
uses: ./.github/workflows/storybook-visual.yml
with:
node-version: "20"
bot-updates:
name: Generates Documentation
permissions:
contents: write
secrets: inherit
uses: ./.github/workflows/automatic_doc_generation.yml
with:
python-version: "3.7"

build:
needs:
Expand Down Expand Up @@ -308,7 +316,7 @@ jobs:
poetry install
mkdir tests/packaged
poetry run ucc-gen package --path tests/testdata/expected_addons/expected_output_global_config_everything/Splunk_TA_UCCExample -o tests/packaged
- uses: splunk/appinspect-cli-action@v2.7
- uses: splunk/appinspect-cli-action@v2.8
with:
app_path: tests/packaged
included_tags: ${{ matrix.tags }}
Expand All @@ -323,6 +331,7 @@ jobs:
- test-ui
- build-test-addon-openapi-client
- storybook-screenshots
- bot-updates
runs-on: ubuntu-latest
env:
NEEDS: ${{ toJson(needs) }}
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,6 @@ init_addon_for_ucc_package/
# UI build
# ignore everything except redirect_page.js
splunk_add_on_ucc_framework/package/appserver/static/js/build/
!splunk_add_on_ucc_framework/package/appserver/static/js/build/redirect_page.js
!splunk_add_on_ucc_framework/package/appserver/static/js/build/redirect_page.js
coverage.xml
.coverage
10 changes: 9 additions & 1 deletion .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
# MD001/heading-increment
MD001: false

ul-style:
style: sublist

MD007:
# set indent as 4 spaces
# reason: https://python-markdown.github.io/#differences
indent: 4

# MD010/no-hard-tabs
MD010:
# Include code blocks
Expand Down Expand Up @@ -38,4 +46,4 @@ MD040: false
MD041: false

# MD046/code-block-style
MD046: false
MD046: false
4 changes: 2 additions & 2 deletions docs/advanced/groups_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ The groups will be displayed at the bottom of the form.
- `label` displays the title of a specific group.
- `fields` specifies the list of fields in a group. All fields must be present in the **entity**.
- `options`:
- `isExpandable` can be used to hide/show fields of the group. The default value is **false**.
- `expand` can be used to show all fields of the group while opening the form. The default value is **false**.
+ `isExpandable` can be used to hide/show fields of the group. The default value is **false**.
+ `expand` can be used to show all fields of the group while opening the form. The default value is **false**.

### Usage

Expand Down
66 changes: 33 additions & 33 deletions docs/advanced/oauth_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@ Auth can be used inside the entity tag. Use `type: "oauth"` in the entity list a

- `type` field value must be oauth.
- `options`:
- `auth_type` must be present. It can have either ["basic", "oauth"] (If we want basic and oauth both support) or ["oauth"] (If we want oauth support only).
- `basic` must be present only if the auth_type is ["basic"].
- This will have a list of fields for you to add in the basic authentication flow. In the given example, it is username, password, and security_token.
- **Note: As of now, if you are selecting basic as auth_type, then the username and password fields are mandatory.**
- `oauth` will have a list of fields for you to add in the oauth authentication flow. In the given example, it is `client_id`, `client_secret`, `redirect_url`, `scope`, and `endpoint`.
- These fields are mandatory:
- `client_id` is the client id for applying auth to your app or apps.
- `client_secret` is the client secret for applying auth to your app or apps.
- `redirect_url` will show the redirect url, which needs to be put in the app's redirect url.
- `endpoint` will be the endpoint for you to build oauth support. For example, for salesforce, it will either be "login.salesforce.com", "test.salesforce.com", or any other custom endpoint.
- There is also the ability to specify separate endpoints for authorize and token. To do this, instead of the single 'endpoint' field, use two separate ones:
- `endpoint_authorize` specifies the endpoint used for authorization, for example, login.salesforce.com.
- `endpoint_token` specifies the endpoint used for the token acqusition, for example, api.login.salesforce.com.
- `auth_code_endpoint` must be present and its value should be the endpoint value for getting the auth_code using the app. If the url to get the auth_code is https://login.salesforce.com/services/oauth2/authorize, then this will have the value /services/oauth2/authorize.
- `access_token_endpoint` must be present and its value should be the endpoint value for getting the ccess_token using the auth_code received. If the url to get the access token is https://login.salesforce.com/services/oauth2/token, then it will have the value /services/oauth2/token.
- `auth_label` allows the user to have the custom label for the Auth Type dropdown.
- `oauth_popup_width` is the width in pixels of the pop-up window that will open for oauth authentication (Optional, defaults to 600).
- `oauth_popup_height` is the height in pixels of the pop-up window that will open for oauth authentication (Optional, defaults to 600).
- `oauth_timeout` is the timeout in seconds for oauth authentication (Optional, defaults to 180 seconds).
- `oauth_state_enabled` is used to include the state for oauth authentication (default value is false).
- `auth_endpoint_token_access_type` is an optional parameter that is mapped into the value of the token_access_type query param in the authorisation url.
+ `auth_type` must be present. It can have either ["basic", "oauth"] (If we want basic and oauth both support) or ["oauth"] (If we want oauth support only).
+ `basic` must be present only if the auth_type is ["basic"].
- This will have a list of fields for you to add in the basic authentication flow. In the given example, it is username, password, and security_token.
- **Note: As of now, if you are selecting basic as auth_type, then the username and password fields are mandatory.**
+ `oauth` will have a list of fields for you to add in the oauth authentication flow. In the given example, it is `client_id`, `client_secret`, `redirect_url`, `scope`, and `endpoint`.
+ These fields are mandatory:
- `client_id` is the client id for applying auth to your app or apps.
- `client_secret` is the client secret for applying auth to your app or apps.
- `redirect_url` will show the redirect url, which needs to be put in the app's redirect url.
- `endpoint` will be the endpoint for you to build oauth support. For example, for salesforce, it will either be "login.salesforce.com", "test.salesforce.com", or any other custom endpoint.
+ There is also the ability to specify separate endpoints for authorize and token. To do this, instead of the single 'endpoint' field, use two separate ones:
- `endpoint_authorize` specifies the endpoint used for authorization, for example, login.salesforce.com.
- `endpoint_token` specifies the endpoint used for the token acqusition, for example, api.login.salesforce.com.
+ `auth_code_endpoint` must be present and its value should be the endpoint value for getting the auth_code using the app. If the url to get the auth_code is https://login.salesforce.com/services/oauth2/authorize, then this will have the value /services/oauth2/authorize.
+ `access_token_endpoint` must be present and its value should be the endpoint value for getting the ccess_token using the auth_code received. If the url to get the access token is https://login.salesforce.com/services/oauth2/token, then it will have the value /services/oauth2/token.
+ `auth_label` allows the user to have the custom label for the Auth Type dropdown.
+ `oauth_popup_width` is the width in pixels of the pop-up window that will open for oauth authentication (Optional, defaults to 600).
+ `oauth_popup_height` is the height in pixels of the pop-up window that will open for oauth authentication (Optional, defaults to 600).
+ `oauth_timeout` is the timeout in seconds for oauth authentication (Optional, defaults to 180 seconds).
+ `oauth_state_enabled` is used to include the state for oauth authentication (default value is false).
+ `auth_endpoint_token_access_type` is an optional parameter that is mapped into the value of the token_access_type query param in the authorisation url.

- The fields allowed in the basic and oauth fields are the following:
- `oauth_field` should be kept as it is and without any change.
- `label` can be changed if the user wants to change the label of the field in UI.
- `field` must keep it as it is for mandatory fields as mentioned before.
- `help` can be changed the if user wants to change the help text displayed below the field.
- `encrypted` should be true if the user wants that particular field encrypted, otherwise, there is no need to have this parameter.
- `required` specifies whether the field is required or not. The default value is true.
- `defaultValue` is the initial input value (string, number, or boolean).
- `options`:
- `placeholder`: (RENOUNCED) The placeholder for the field.
- `disableonEdit`: When the form is in edit mode, the field becomes unable to be edited. The default value is false.
- `enable`: The enable property sets whether a field is enabled or not. The default value is true.
+ The fields allowed in the basic and oauth fields are the following:
- `oauth_field` should be kept as it is and without any change.
- `label` can be changed if the user wants to change the label of the field in UI.
- `field` must keep it as it is for mandatory fields as mentioned before.
- `help` can be changed the if user wants to change the help text displayed below the field.
- `encrypted` should be true if the user wants that particular field encrypted, otherwise, there is no need to have this parameter.
- `required` specifies whether the field is required or not. The default value is true.
- `defaultValue` is the initial input value (string, number, or boolean).
- `options`:
+ `placeholder`: (RENOUNCED) The placeholder for the field.
+ `disableonEdit`: When the form is in edit mode, the field becomes unable to be edited. The default value is false.
+ `enable`: The enable property sets whether a field is enabled or not. The default value is true.

> [!WARNING]
> The [Placeholder](https://splunkui.splunkeng.com/Packages/react-ui/Text?section=develop) attribute is deprecated and renounced. Instead, we recommend to use the "help" attribute.
Expand Down
25 changes: 25 additions & 0 deletions docs/advanced/os-dependent_libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,31 @@ and your pip command should look like this:<br>
A dot in the platform part indicates that a given distribution supports several platforms.
In this case, "**.**" in **manylinux_2_17_x86_64.manylinux2014_x86_64** means this distribution supports both **manylinux_2_17_x86_64** and **manylinux2014_x86_64**.

Currently supported python versions are "3.7" and "3.9". Syntax without dots ("37" or "39") is also supported.

If there are libraries specified for different python versions, they must have **different target** paths.

```
"os-dependentLibraries": [
{
"name": "cryptography",
"version": "41.0.5",
"platform": "manylinux2014_x86_64",
"python_version": "37",
"os": "linux",
"target": "3rdparty/linux_libs"
},
{
"name": "cryptography",
"version": "41.0.5",
"dependencies": true,
"platform": "manylinux2014_x86_64",
"python_version": "3.9",
"os": "linux",
"target": "3rdparty/linux_lib_py39"
},
```

For more informations, see [.whl](https://www.youtube.com/watch?v=4L0Jb3Ku81s) and [manylinux platform](https://www.youtube.com/watch?v=80j-MRtHMek).

### Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/alert_actions/adaptive_response.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ An example of adaptive response in globalConfig:
"label": "Test Alert",
"description": "Description for test Alert Action",
"iconFileName": "test icon.png",
"activeResponse": {
"adaptiveResponse": {
"task": [
"Create",
"Update"
Expand Down
8 changes: 4 additions & 4 deletions docs/alert_actions/alert_scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ The following files would be created/ updated in the output folder once you exec
In the python file that is created, below are the methods that you can use or override for varying use cases:

- `process_event()`
- This is the start point of where you require to write the logic of sending data from Splunk to any other
+ This is the start point of where you require to write the logic of sending data from Splunk to any other
service via its APIs. Additionally, you can validate the parameters that are provided in the alert action
as client side validation (via JavaScript) isn't allowed in Splunk's alert action's HTML page for
security reasons. <br> Note: This method must be overwritten.
- `get_events()` -> List[dict]
- Used to get the events that triggered the alert. It returns a list of dictionary. A dictionary points to an event that triggered the alert, and each dictionary has the fields extracted by Splunk.
+ Used to get the events that triggered the alert. It returns a list of dictionary. A dictionary points to an event that triggered the alert, and each dictionary has the fields extracted by Splunk.
- `addevent(raw: str, sourcetype: str)`
- If you are bringing additional information from an outer service, you can write that information using this method. You write a single record using the method. This method will append all the records and will dump it to Splunk when `writeevents()` method is called.
+ If you are bringing additional information from an outer service, you can write that information using this method. You write a single record using the method. This method will append all the records and will dump it to Splunk when `writeevents()` method is called.
- `writeevents(index: str, host: str, source: str)`
- All the events added to the queue using `addevent()` method are written to Splunk with the details passed in the arguments.
+ All the events added to the queue using `addevent()` method are written to Splunk with the details passed in the arguments.

An example of a script with validations:

Expand Down
2 changes: 1 addition & 1 deletion docs/alert_actions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Developers are required to add alerts in the global config file to create an Ale

| Property | Type | Description |
|---------------------------------------------------------------------------|--------|--------------------------------------------------------------------------------------------------------|
| type<span class="required-asterisk">\*</span> | string | The type of the user input in the alert. Available choices: "text", "checkbox", "singleSelect", "radio", "singleSelectSplunkSearch". |
| type<span class="required-asterisk">\*</span> | string | The type of the user input in the alert. Available choices: "text", "textarea", "checkbox", "singleSelect", "radio", "singleSelectSplunkSearch". |
| label<span class="required-asterisk">\*</span> | string | The text that would be shown in the alert action UI. |
| field<span class="required-asterisk">\*</span> | string | The field that would be used in the scripts to get the value from the user input. These are defined as `param.<field_mentioned>` in the `alert_actions.conf`. |
| options | array | Static choices that a user can select in the alert action UI. |
Expand Down
8 changes: 4 additions & 4 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ gh pr merge main --auto --merge
```
- If a release encounters issues requiring a quick bug fix (handled by the UCC team):
- Create a PR to the main branch with the fix, including tests that reproduce and then fix the issue.
- Ensure CI passes and await team review.
- Merge the PR using the merge commit option on GitHub.
- Backport the bug fix PR to the develop branch.
+ Create a PR to the main branch with the fix, including tests that reproduce and then fix the issue.
+ Ensure CI passes and await team review.
+ Merge the PR using the merge commit option on GitHub.
+ Backport the bug fix PR to the develop branch.
2 changes: 1 addition & 1 deletion docs/custom_ui_extensions/custom_row.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
When a row is expanded on the Inputs table, Custom Row is utilized to incorporate a customized element. By clicking on the icon provided on the left side of each row, the input-specific details are displayed.
When a row is expanded on the Inputs table or Configuration Table, Custom Row is utilized to incorporate a customized element. By clicking on the icon provided on the left side of each row, the input-specific details are displayed.

### Properties

Expand Down
21 changes: 21 additions & 0 deletions docs/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,27 @@ except Exception as e:
log.log_exception(logger, e, "Other")
```

By default, the error section displays events logged with the ERROR level, but since version **5.50** UCC allows the user to define what level of logs should be displayed in this section. There are two levels to choose from:

* ERROR
* CRITICAL

```json
"dashboard": {
"panels": [
{
"name": "default"
}
],
"settings": {
"error_panel_log_lvl": [
"ERROR",
"CRITICAL"
]
}
}
```

## Configuration

To be able to add a monitoring dashboard page to an existing add-on, you need to adjust your
Expand Down
Loading

0 comments on commit 69c02a6

Please sign in to comment.