Skip to content

Commit

Permalink
Merge branch 'develop' into feat/spike-poc-dashboard-side-panel
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanm-crest committed Sep 20, 2024
2 parents 043307b + 7ce9ecf commit 4db569a
Show file tree
Hide file tree
Showing 29 changed files with 1,468 additions and 1,413 deletions.
8 changes: 8 additions & 0 deletions .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
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
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
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.
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
4 changes: 2 additions & 2 deletions docs/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Metadata contains general information about add-on build.
| Property | Type | Description |
|---------------------------------------------------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| displayName<span class="required-asterisk">\*</span> | string | Name displayed for end user. |
| name<span class="required-asterisk">\*</span> | string | Name used for API endpoints and all code references separating separating endpoints from any other app. |
| restRoot<span class="required-asterisk">\*</span> | string | String used to create API endpoints. <br> Follow patter `/^\w+$/`. |
| name<span class="required-asterisk">\*</span> | string | Name used for API endpoints and all code references separating endpoints from any other app. Please refer to [app.conf/[package]/id](https://docs.splunk.com/Documentation/Splunk/latest/Admin/Appconf#.5Bpackage.5D) for more details. |
| restRoot<span class="required-asterisk">\*</span> | string | String used to create API endpoints, allows alphanumeric and `-` characters. |
| apiVersion | string | [Deprecated] Version of used API. |
| version<span class="required-asterisk">\*</span> | string | Version of the add-on. |
| schemaVersion | string | Version of JSON schema used in build process. |
Expand Down
14 changes: 8 additions & 6 deletions docs/openapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ The OpenAPI Description document can be used to create:

* interactive documentation that generates simple curl requests to all documented endpoints (check [this section](#how-to-get-curl-commands-and-use-them) for the relevant instructions).
* automation that uses the simple requests to create more complex solutions such as:
* orchestration
* mass load or migration
* automated tests.
- orchestration
- mass load or migration
- automated tests.

Check [swagger](https://swagger.io/) or [other tools](https://github.com/OAI/OpenAPI-Specification/blob/main/IMPLEMENTATIONS.md) for more possibilities.

Expand All @@ -44,7 +44,7 @@ Check [swagger](https://swagger.io/) or [other tools](https://github.com/OAI/Ope
### Instructions

1. Open https://editor.swagger.io/
* Alternatively, you can run your own instance of Swagger Editor
- Alternatively, you can run your own instance of Swagger Editor
by running the following command in terminal:

`docker run -p 8081:8080 swaggerapi/swagger-editor`
Expand Down Expand Up @@ -80,12 +80,14 @@ Make sure you clicked the Authorize button, gave the username and password, and

1. Go to the directory where you downloaded `openapi.json` file
2. Run the following command: `docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i /local/openapi.json -g python -o /local/restapi_client`
* make sure `openapi.json` is in the current directory
* you can generate clients for other languages as well - run

- make sure `openapi.json` is in the current directory
- you can generate clients for other languages as well - run

`docker run --rm openapitools/openapi-generator-cli generate list`

to see the list of supported languages

3. The client should appear in `restapi_client`. Open that directory (`cd restapi_client`)
4. Install the client (`pip install .`)
5. See `README.md` for an example of usage
Expand Down
12 changes: 5 additions & 7 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,12 @@ It accepts the following parameters:
the `output/<package_ID>/appserver/static/js/build` directory.
* collects and installs the add-on's requirements into the
`output/<package_ID>/lib` directory of add-on's package.
* NOTE: For the add-on's requirements, the packages are installed according to
following information:
* `lib/requirements.txt` installs Python3 compatible packages into
the `output/<package_ID>/lib`.
* It removes `setuptools*`, `bin*`, `pip*`, `distribute*`, and `wheel*` if
they exist from `output/<package_ID>/lib`
* It removes the execute bit from every file under `output/<package_ID>/lib`.
* replaces tokens in views.
* copies the add-on's `package/*` to the `output/<package_ID>/*` directory.
* If an add-on requires some additional configurations in packaging,
then `ucc-gen` runs the code in the `additional_packaging.py` file as well.
* **NOTE:** For the add-on's requirements, the packages are installed according to following information:
- `lib/requirements.txt` installs Python3 compatible packages into the `output/<package_ID>/lib`.
- It removes `setuptools*`, `bin*`, `pip*`, `distribute*`, and `wheel*` if they exist from `output/<package_ID>/lib`
- It removes the execute bit from every file under `output/<package_ID>/lib`.
* **NOTE:** The build won't be generated only when the add-on name in `meta[name]` of `globalConfig` and `info[id][name]` in `app.manifest` are not same.
Loading

0 comments on commit 4db569a

Please sign in to comment.