Skip to content

Commit 5f9c90b

Browse files
Update non java files (opensearch-project#2812)
* Isolate spotless config changes Signed-off-by: Craig Perkins <[email protected]> * update dlic/auth package style Signed-off-by: Stephen Crawford <[email protected]> * Update formatterConfig.xml --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Stephen Crawford <[email protected]> Co-authored-by: Craig Perkins <[email protected]>
1 parent 4b38671 commit 5f9c90b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+553
-168
lines changed

.github/actions/create-bwc-build/action.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ inputs:
55
plugin-branch:
66
description: 'The branch of the plugin that should be built, e.g "2.2", "1.x"'
77
required: true
8-
8+
99
outputs:
1010
built-version:
1111
description: 'The version of OpenSearch that was associated with this branch'

.github/actions/start-opensearch-with-one-plugin/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ runs:
7070
# Run any configuration scripts
7171
- name: Run Setup Script for Linux
7272
if: ${{ runner.os == 'Linux' && inputs.setup-script-name != '' }}
73-
run: |
73+
run: |
7474
echo "running linux setup"
7575
chmod +x ./${{ inputs.setup-script-name }}.sh
7676
./${{ inputs.setup-script-name }}.sh

.github/workflows/delete_backport_branch.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Delete merged branch of the backport PRs
2-
on:
2+
on:
33
pull_request:
44
types:
55
- closed
6-
6+
77
jobs:
88
delete-branch:
99
runs-on: ubuntu-latest

.github/workflows/plugin_install.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
if: ${{ runner.os == 'Linux' }}
3939
run: |
4040
cat > setup.sh <<'EOF'
41-
chmod +x ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh
41+
chmod +x ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh
4242
/bin/bash -c "yes | ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh"
4343
EOF
4444

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
OpenSearch is a community project that is built and maintained by people just like **you**.
66
[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects.
77

8-
Visit the following link(s) for more information on specific practices:
8+
Visit the following link(s) for more information on specific practices:
99

1010
- [Triaging](./TRIAGING.md)
1111

DEVELOPER_GUIDE.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ The `curl localhost:9200` call should succeed again. Kill the server with `Ctrl+
4848

4949
>Worth noting:\
5050
> The version of OpenSearch and the security plugin must match as there is an explicit version check at startup. This can be a bit confusing as, for example, at the time of writing this guide, the `main` branch of this security plugin builds version `3.0.0.0-SNAPSHOT` compatible with OpenSearch `3.0.0`. Check the expected compatible version in `build.gradle` file [here](https://github.com/opensearch-project/security/blob/main/build.gradle) and make sure you get the correct branch from OpenSearch when building that project.
51-
>
51+
>
5252
> The line to look for: `opensearch_version = System.getProperty("opensearch.version", "x")`
53-
>
53+
>
5454
> Alternatively, you can find the compatible version of OpenSearch by running in project root folder
5555
> ```
5656
> ./gradlew properties -q | grep -E '^version:' | awk '{print $2}'
@@ -164,7 +164,7 @@ Checkstyle enforces several rules within this codebase. Sometimes it will be nec
164164

165165
*Execute Checkstyle*
166166
```
167-
./gradlew checkstyleMain checkstyleTest
167+
./gradlew checkstyleMain checkstyleTest
168168
```
169169

170170
*Example violation*

DEVELOPING_WITH_DOCKER.md

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
# Developing with Docker
22

3-
Docker is a powerful tool that can be used to quickly spin up an OpenSearch cluster. When you follow the steps to run [OpenSearch with Docker](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/), you will find the Security Plugin already included in the basic distribution.
3+
Docker is a powerful tool that can be used to quickly spin up an OpenSearch cluster. When you follow the steps to run [OpenSearch with Docker](https://opensearch.org/docs/latest/install-and-configure/install-opensearch/docker/), you will find the Security Plugin already included in the basic distribution.
44

55
- [Developing with Docker](#developing-with-docker)
66
- [Configuring Security](#configuring-security)
77
- [Mounting Local Volumes](#mounting-local-volumes)
88
- [Example docker-compose](#example-docker-compose)
9-
109

11-
## Configuring Security
1210

13-
By default, the Docker installation of OpenSearch does not enable the Security plugin. In order to enable Security development, you will need set `DISABLE_SECURITY_PLUGIN=false`, as well as change `DISABLE_INSTALL_DEMO_CONFIG` and `DISABLE_SECURITY_DASHBOARDS_PLUGIN`. This will install the demo certificates, and allow you to develop with realistic Security configurations. An example of a completely configured docker-compose file is shown below.
11+
## Configuring Security
12+
13+
By default, the Docker installation of OpenSearch does not enable the Security plugin. In order to enable Security development, you will need set `DISABLE_SECURITY_PLUGIN=false`, as well as change `DISABLE_INSTALL_DEMO_CONFIG` and `DISABLE_SECURITY_DASHBOARDS_PLUGIN`. This will install the demo certificates, and allow you to develop with realistic Security configurations. An example of a completely configured docker-compose file is shown below.
1414

1515
> Warning: You should never use the demo certificates for a production environment. Instead, you will need to follow the steps on [configuring security](https://opensearch.org/docs/latest/security/configuration/index/) before using the cluster for production.
1616
17-
### Mounting Local Volumes
17+
### Mounting Local Volumes
1818

19-
In order to test development changes with an OpenSearch Docker-installation, you will need to mount the volumes in your docker-compose file.
19+
In order to test development changes with an OpenSearch Docker-installation, you will need to mount the volumes in your docker-compose file.
2020

21-
To update your cluster to have local changes, follow these steps:
21+
To update your cluster to have local changes, follow these steps:
2222

2323
1. First you will need to make changes in your local `opensearch-project/security` repository. For this example, assume your fork is cloned into a directory called `security`.
24-
2. After you make changes to your cloned repository, you will need to run `./gradlew assemble`. This will create a `.jar` file you can mount into the Docker container. The file will be located at `./security/build/distributions/opensearch-security-<OPENSEARCH_VERSION>.0-SNAPSHOT.jar`, where the `<OPENSEARCH_VERSION>` field is simply the OpenSearch distribution.
25-
3. You will then need to navigate to your `docker-compose.yml` file where you are running you OpenSearch cluster from. For this example, let us assume this is in another directory called `opensearch-docker`.
26-
4. Modify the compose file, so that in the `volumes:` section of each node configuration (the default configuration will have `opensearch-node1` and `opensearch-node2`), you have a new line which reads `~/security/build/distributions/opensearch-security-<OPENSEARCH_VERSION>.0-SNAPSHOT.jar:/usr/share/opensearch/plugins/opensearch-security/opensearch-security-<OPENSEARCH_VERSION>.0.jar`. This line should be added to the volumes section of all nodes in the compose file. You will not need to add it to the `opensearch-dashboards` section.
27-
5. You can now restart the Docker container by running `docker-compose down -v` and `docker-compose up`. Your changes will now be live in the OpenSearch cluster instance.
24+
2. After you make changes to your cloned repository, you will need to run `./gradlew assemble`. This will create a `.jar` file you can mount into the Docker container. The file will be located at `./security/build/distributions/opensearch-security-<OPENSEARCH_VERSION>.0-SNAPSHOT.jar`, where the `<OPENSEARCH_VERSION>` field is simply the OpenSearch distribution.
25+
3. You will then need to navigate to your `docker-compose.yml` file where you are running you OpenSearch cluster from. For this example, let us assume this is in another directory called `opensearch-docker`.
26+
4. Modify the compose file, so that in the `volumes:` section of each node configuration (the default configuration will have `opensearch-node1` and `opensearch-node2`), you have a new line which reads `~/security/build/distributions/opensearch-security-<OPENSEARCH_VERSION>.0-SNAPSHOT.jar:/usr/share/opensearch/plugins/opensearch-security/opensearch-security-<OPENSEARCH_VERSION>.0.jar`. This line should be added to the volumes section of all nodes in the compose file. You will not need to add it to the `opensearch-dashboards` section.
27+
5. You can now restart the Docker container by running `docker-compose down -v` and `docker-compose up`. Your changes will now be live in the OpenSearch cluster instance.
2828

29-
### Example docker-compose
29+
### Example docker-compose
3030

31-
This is an example of a completely configured docker-compose file for a local installation of the 2.5.0 version of OpenSearch.
31+
This is an example of a completely configured docker-compose file for a local installation of the 2.5.0 version of OpenSearch.
3232

3333
```
3434
version: '3'
3535
services:
3636
opensearch-node1:
37-
image: opensearchstaging/opensearch:2.5.0 # This is a image of the 2.5.0 distribution
37+
image: opensearchstaging/opensearch:2.5.0 # This is a image of the 2.5.0 distribution
3838
environment:
3939
- cluster.name=opensearch-cluster
4040
- node.name=opensearch-node1
@@ -58,7 +58,7 @@ services:
5858
# - ./config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml # These paths are relative to the location of the docker-compose file
5959
# - ./config/esnode.pem:/usr/share/opensearch/config/esnode.pem
6060
# - ./config/esnode-key.pem:/usr/share/opensearch/config/esnode-key.pem
61-
# - ./config/root-ca.pem:/usr/share/opensearch/config/root-ca.pem
61+
# - ./config/root-ca.pem:/usr/share/opensearch/config/root-ca.pem
6262
# - ./config/opensearch-security/audit.yml:/usr/share/opensearch/config/opensearch-security/audit.yml
6363
# - ./config/opensearch-security/tenants.yml:/usr/share/opensearch/config/opensearch-security/tenants.yml
6464
# - /OpenSearch-Snapshots:/mnt/snapshots # This is where your snapshots would be stored
@@ -86,8 +86,8 @@ services:
8686
# - ./config/root-ca.pem:/usr/share/opensearch/config/root-ca.pem
8787
# - ./config/opensearch-security/audit.yml:/usr/share/opensearch/config/opensearch-security/audit.yml
8888
# - ./config/opensearch-security/tenants.yml:/usr/share/opensearch/config/opensearch-security/tenants.yml
89-
# - /OpenSearch-Snapshots:/mnt/snapshots
90-
# - /security/build/distributions/opensearch-security-2.5.0.0-SNAPSHOT.jar:/usr/share/opensearch/plugins/opensearch-security/opensearch-security-2.5.0.0.jar
89+
# - /OpenSearch-Snapshots:/mnt/snapshots
90+
# - /security/build/distributions/opensearch-security-2.5.0.0-SNAPSHOT.jar:/usr/share/opensearch/plugins/opensearch-security/opensearch-security-2.5.0.0.jar
9191
networks:
9292
- opensearch-net
9393
opensearch-dashboards:

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
[![CI](https://github.com/opensearch-project/security/workflows/CI/badge.svg?branch=main)](https://github.com/opensearch-project/security/actions) [![](https://img.shields.io/github/issues/opensearch-project/security/untriaged?labelColor=red)](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3A"untriaged") [![](https://img.shields.io/github/issues/opensearch-project/security/security%20vulnerability?labelColor=red)](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3A"security%20vulnerability") [![](https://img.shields.io/github/issues/opensearch-project/security)](https://github.com/opensearch-project/security/issues) [![](https://img.shields.io/github/issues-pr/opensearch-project/security)](https://github.com/opensearch-project/security/pulls)
1+
[![CI](https://github.com/opensearch-project/security/workflows/CI/badge.svg?branch=main)](https://github.com/opensearch-project/security/actions) [![](https://img.shields.io/github/issues/opensearch-project/security/untriaged?labelColor=red)](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3A"untriaged") [![](https://img.shields.io/github/issues/opensearch-project/security/security%20vulnerability?labelColor=red)](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3A"security%20vulnerability") [![](https://img.shields.io/github/issues/opensearch-project/security)](https://github.com/opensearch-project/security/issues) [![](https://img.shields.io/github/issues-pr/opensearch-project/security)](https://github.com/opensearch-project/security/pulls)
22
[![](https://img.shields.io/codecov/c/gh/opensearch-project/security)](https://app.codecov.io/gh/opensearch-project/security) [![](https://img.shields.io/github/issues/opensearch-project/security/v2.4.0)](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3A"v2.4.0") [![](https://img.shields.io/github/issues/opensearch-project/security/v3.0.0)](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3A"v3.0.0")
33
[![Slack](https://img.shields.io/badge/Slack-4A154B?&logo=slack&logoColor=white)](https://opensearch.slack.com/archives/C051Y637FKK)
44

55

66

7-
## Announcement: The Slack workspace is live! Please join the [conversation](https://opensearch.slack.com/archives/C051Y637FKK).
7+
## Announcement: The Slack workspace is live! Please join the [conversation](https://opensearch.slack.com/archives/C051Y637FKK).
88

99
<img src="https://opensearch.org/assets/img/opensearch-logo-themed.svg" height="64px">
1010

@@ -37,7 +37,7 @@ OpenSearch Security is a plugin for OpenSearch that offers encryption, authentic
3737
* Full data in transit encryption
3838
* Node-to-node encryption
3939
* Certificate revocation lists
40-
* Hot Certificate renewal
40+
* Hot Certificate renewal
4141

4242
### Authentication
4343
* Internal user database
@@ -60,7 +60,7 @@ OpenSearch Security is a plugin for OpenSearch that offers encryption, authentic
6060
* REST management API
6161

6262
### Audit/Compliance logging
63-
* Audit logging
63+
* Audit logging
6464
* Compliance logging for GDPR, HIPAA, PCI, SOX and ISO compliance
6565

6666
### OpenSearch Dashboards multi-tenancy
@@ -126,7 +126,7 @@ sequenceDiagram
126126
participant OpenSearch
127127
participant SecurityPlugin
128128
participant Cluster as Plugin
129-
129+
130130
Client->>OpenSearch: Request
131131
OpenSearch->>SecurityPlugin: Request
132132
SecurityPlugin->>SecurityPlugin: Add Auth information to request context
@@ -188,7 +188,7 @@ If you discover a potential security issue in this project we ask that you notif
188188

189189
## License
190190

191-
This code is licensed under the Apache 2.0 License.
191+
This code is licensed under the Apache 2.0 License.
192192

193193
## Copyright
194194

TRIAGING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ If you have an issue you'd like to bring forth please consider getting a link to
2020

2121
### Is there an agenda for each week?
2222

23-
Meetings are lightly structured as follows:
23+
Meetings are lightly structured as follows:
2424

2525
1. Announcements: If there are any announcements to be made they will happen at the start of the meeting.
2626
2. Review of new issues: The meetings always start with reviewing all untriaged [issues](https://github.com/search?q=label%3Auntriaged+is%3Aopen++repo%3Aopensearch-project%2Fsecurity+repo%3Aopensearch-project%2Fsecurity-dashboards-plugin&type=issues&ref=advsearch&s=created&o=desc) for the security and security-dashboards repositories.
@@ -53,7 +53,7 @@ There you can find answers to many common questions as well as speak with implem
5353

5454
### What if my issue is critical to OpenSearch operations, do I have to wait for the weekly meeting for it to be addressed?
5555

56-
All new issues for the [security](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3Auntriaged) repo and [security-dashboards](https://github.com/opensearch-project/security-dashboards-plugin/issues?q=is%3Aissue+is%3Aopen+-label%3Atriaged) repo are reviewed daily to check for critical issues which require immediate triaging. If an issue relates to a severe concern for OpenSearch operation, it will be triaged by a maintainer mid-week. You can still come to discuss an issue at the following meeting even if it has already been triaged during the week.
56+
All new issues for the [security](https://github.com/opensearch-project/security/issues?q=is%3Aissue+is%3Aopen+label%3Auntriaged) repo and [security-dashboards](https://github.com/opensearch-project/security-dashboards-plugin/issues?q=is%3Aissue+is%3Aopen+-label%3Atriaged) repo are reviewed daily to check for critical issues which require immediate triaging. If an issue relates to a severe concern for OpenSearch operation, it will be triaged by a maintainer mid-week. You can still come to discuss an issue at the following meeting even if it has already been triaged during the week.
5757

5858
### Is this where I should bring up potential security vulnerabilities?
5959

build.gradle

+1-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*/
1111

1212

13-
import com.diffplug.gradle.spotless.JavaExtension
1413
import org.opensearch.gradle.test.RestIntegTestTask
1514

1615
buildscript {
@@ -70,23 +69,11 @@ apply plugin: 'opensearch.opensearchplugin'
7069
apply plugin: 'opensearch.pluginzip'
7170
apply plugin: 'opensearch.rest-test'
7271
apply plugin: 'opensearch.testclusters'
72+
apply from: 'gradle/formatting.gradle'
7373

7474
licenseFile = rootProject.file('LICENSE.txt')
7575
noticeFile = rootProject.file('NOTICE.txt')
7676

77-
spotless {
78-
java {
79-
// note: you can use an empty string for all the imports you didn't specify explicitly, and '\\#` prefix for static imports
80-
importOrder('java', 'javax', '', 'com.amazon', 'org.opensearch', '\\#')
81-
targetExclude('src/integrationTest/**')
82-
}
83-
format("integrationTest", JavaExtension) {
84-
target('src/integrationTest/java/**/*.java')
85-
importOrder('java', 'javax', '', 'com.amazon', 'org.opensearch', '\\#')
86-
indentWithTabs(4)
87-
}
88-
}
89-
9077
spotbugs {
9178
includeFilter = file('spotbugs-include.xml')
9279
}

0 commit comments

Comments
 (0)