Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
- Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
- Please make sure all these things are done and tick the boxes

# Reviewer
## Reviewer

- [ ] Code contains useful comments
- [ ] (Integration-)Test cases added
- [ ] Documentation added or updated
- [ ] Changelog updated

# Acceptance
## Acceptance

- [ ] Proper release label has been added
10 changes: 8 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- {druid: druid-35.0.1, java: '21'}
- {druid: druid-37.0.0, java: '21'}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

Expand All @@ -38,7 +38,13 @@ jobs:
cache: maven

- name: Build with Maven
run: mvn -B verify -P${{ matrix.profile.druid }}
run: |
./mvnw \
--batch-mode \
--no-transfer-progress \
--file pom.xml \
-P${{ matrix.profile.druid }} \
clean verify

- name: Update dependency graph
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_prek.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
submodules: recursive
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
echo "JAVA_VERSION=unknown" >> "$GITHUB_ENV"
fi

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ build

.idea

target
target
7 changes: 7 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ MD013:
# Number of characters for code blocks
code_block_line_length: 9999

# MD033/no-inline-html
MD033:
allowed_elements: [h1, img, p]

# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content
MD024:
# Only check sibling headings
siblings_only: true

# MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading
MD041: false # Github issues and PRs already have titles, and H1 is enormous in the description box.
3 changes: 3 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrapperVersion=3.3.4
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-case-conflict
- id: check-json
- id: check-yaml
- id: check-xml
- id: detect-private-key
- id: detect-aws-credentials
args: ["--allow-missing-credentials"]
- id: detect-private-key

- repo: https://github.com/adrienverge/yamllint
rev: 79a6b2b1392eaf49cdd32ac4f14be1a809bbd8f7 # 1.37.1
Expand All @@ -22,12 +27,16 @@ repos:
rev: 192ad822316c3a22fb3d3cc8aa6eafa0b8488360 # 0.45.0
hooks:
- id: markdownlint
types: [text]
files: \.md(\.j2)*$

- repo: https://github.com/koalaman/shellcheck-precommit
rev: 99470f5e12208ff0fb17ab81c3c494f7620a1d8d # 0.11.0
hooks:
- id: shellcheck
args: ["--severity=info"]


- repo: https://github.com/rhysd/actionlint
rev: e7d448ef7507c20fc4c88a95d0c448b848cd6127 # 1.7.8
hooks:
Expand Down
6 changes: 6 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ rules:
check-keys: false
comments:
min-spaces-from-content: 1 # Needed due to https://github.com/adrienverge/yamllint/issues/443
indentation:
indent-sequences: consistent
comments-indentation: disable # This is generally useless and interferes with commented example values
braces:
max-spaces-inside: 1
max-spaces-inside-empty: 0
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ This project was tested against these Druid versions:

## Building

This repository uses Maven and requires at least Java 17/21 (depending on the Druid version) to build:
This repository uses Maven and requires at least Java 17/21 (depending on the Druid version) to build.
Use the bundled Maven Wrapper so the build uses a pinned Maven version:

mvn -P druid-37.0.0 clean package
./mvnw -P druid-37.0.0 clean package

Please check that the Druid version you are building for is supported and adapt the profile accordingly.
The result of this is a JAR file in the `target` directory.
Expand Down
12 changes: 6 additions & 6 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ In Druid in your common `runtime.properties` add the following:
# Druid basic security
druid.auth.authenticatorChain=["basicAuthenticator"]
druid.auth.authenticator.basicAuthenticator.type=basic

# Default password for 'admin' user, should be changed for production.
druid.auth.authenticator.basicAuthenticator.initialAdminPassword=password1

# Default password for internal 'druid_system' user, should be changed for production.
druid.auth.authenticator.basicAuthenticator.initialInternalClientPassword=password2

# Uses the metadata store for storing users, you can use authentication API to create new users and grant permissions
druid.auth.authenticator.basicAuthenticator.credentialsValidator.type=metadata

# If true and the request credential doesn't exists in this credentials store, the request will proceed to next Authenticator in the chain.
druid.auth.authenticator.basicAuthenticator.skipOnFailure=false
druid.auth.authenticator.basicAuthenticator.authorizerName=opaAuthorizer

# Escalator
druid.escalator.type=basic
druid.escalator.internalClientUsername=druid_system
druid.escalator.internalClientPassword=password2
druid.escalator.authorizerName=opaAuthorizer

druid.auth.authorizers=["opaAuthorizer"]
druid.auth.authorizer.opaAuthorizer.type=opa
druid.auth.authorizer.opaAuthorizer.opaUri=http://localhost:8181/v1/data/app/druid/allow
Expand Down
2 changes: 1 addition & 1 deletion example/setup/alice_pass.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"password": "alice"
}
}
2 changes: 1 addition & 1 deletion example/setup/bob_pass.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"password": "bob"
}
}
2 changes: 1 addition & 1 deletion example/setup/christy_pass.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"password": "christy"
}
}
2 changes: 1 addition & 1 deletion example/setup/dylan_pass.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"password": "dylan"
}
}
2 changes: 1 addition & 1 deletion example/setup/eve_pass.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"password": "eve"
}
}
4 changes: 2 additions & 2 deletions example/setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ authenticator_name=MyBasicMetadataAuthenticator

create_user() {
local user=$1
curl -u admin:password1 -XPOST ${protocol}://$coordinator_ip:${coordinator_port}/druid-ext/basic-security/authentication/db/${authenticator_name}/users/${user}
curl -u admin:password1 -H'Content-Type: application/json' -XPOST --data-binary @${user}_pass.json ${protocol}://$coordinator_ip:${coordinator_port}/druid-ext/basic-security/authentication/db/${authenticator_name}/users/${user}/credentials
curl -u admin:password1 -XPOST ${protocol}://$coordinator_ip:${coordinator_port}/druid-ext/basic-security/authentication/db/${authenticator_name}/users/"${user}"
curl -u admin:password1 -H'Content-Type: application/json' -XPOST --data-binary @"${user}"_pass.json ${protocol}://$coordinator_ip:${coordinator_port}/druid-ext/basic-security/authentication/db/${authenticator_name}/users/"${user}"/credentials
}

create_user alice
Expand Down
Loading
Loading