Skip to content
Merged
Changes from 1 commit
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
63 changes: 61 additions & 2 deletions demos/global-matrix-auth/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# matrix-auth-plugin

Requires `matrix-auth` >= 3.0
Requires `matrix-auth` >= 3.2
> Starting from version 3.2 of the `matrix-auth` plugin, the JCasC syntax for configuring permissions has changed. The previous `permissions:` format is deprecated and replaced with a structured `entries:` format. While older configurations may still work with `deprecated: warn`, it is recommended to migrate to the new format.

There are a couple of built-in authorizations to consider.

Expand All @@ -9,6 +10,30 @@ There are a couple of built-in authorizations to consider.

## sample-configuration (global matrix)

Updated Configuration:
```yaml
jenkins:
authorizationStrategy:
globalMatrix:
entries:
- user:
name: "admin"
permissions:
- "Overall/Administer"
- user:
name: "anonymous"
permissions:
- "Overall/Read"
- group:
name: "authenticated"
permissions:
- "Overall/Administer"
```
Permissions must be defined **per line**, meaning each line must grant permission to only a single role, and only a single user or group of users.



## Deprecated Configuration (Pre-3.2)
```yaml
jenkins:
authorizationStrategy:
Expand All @@ -18,10 +43,44 @@ jenkins:
- "GROUP:Overall/Administer:authenticated"
- "USER:Overall/Administer:admin"
```
Permissions must be defined **per line**, meaning each line must grant permission to only a single role, and only a single user or group of users.



## sample-configuration (project based matrix)

```yaml
jenkins:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you update the integration test to use this to prove it works please (and continues to work):

https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/integrations/src/test/java/io/jenkins/plugins/casc/ProjectMatrixAuthorizationTest.java

It will need to change to use the JenkinsConfiguredWithReadmeRule

You can then append #<heading-number> to the ConfiguredWithReadme so that it uses the right example, like in:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a pleasure for me to work on the repo.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you haven't done this

authorizationStrategy:
projectMatrix:
entries:
- group:
name: "authenticated"
permissions:
- "View/Delete"
- "View/Read"
- "View/Configure"
- "View/Create"
- "Job/Read"
- "Job/Build"
- "Job/Configure"
- "Job/Create"
- "Job/Delete"
- "Job/Discover"
- "Job/Move"
- "Job/Workspace"
- "Job/Cancel"
- "Run/Delete"
- "Run/Replay"
- "Run/Update"
- "SCM/Tag"
- "Overall/Administer"
- user:
name: "anonymous"
permissions:
- "Overall/Read"
```

## Deprecated Configuration for Project Matrix (Pre-3.2)
```yaml
jenkins:
authorizationStrategy:
Expand Down