Skip to content

[Feature] Check for and perform upgrades on security configurations#4102

Merged
DarshitChanpura merged 23 commits intoopensearch-project:mainfrom
peternied:upgrade-roles
Mar 20, 2024
Merged

[Feature] Check for and perform upgrades on security configurations#4102
DarshitChanpura merged 23 commits intoopensearch-project:mainfrom
peternied:upgrade-roles

Conversation

@peternied
Copy link
Copy Markdown
Member

@peternied peternied commented Mar 8, 2024

Description

This adds a new API that allows for checking and updating configurations from the default configurations on disk. Initial feature supports only Roles.

Response when no upgrade is available

GET _plugins/_security/api/_upgrade_check
200 {
  "status": "ok",
  "upgradeAvailable" : false
}

Response when a new role is available

GET _plugins/_security/api/_upgrade_check
200 {
  "status": "ok",
  "upgradeAvailable" : true,
  "upgradeActions" : {
    "roles" : {
      "add" : [ "flow_framework_full_access" ]
    }
  }
}

Response when a new role + existing role were updated

GET _plugins/_security/api/_upgrade_check
200 {
  "status": "ok",
  "upgradeAvailable" : true,
  "upgradeActions" : {
    "roles" : {
      "add" : [ "flow_framework_full_access" ],
      "modify" : [ "flow_framework_read_access" ]
    }
  }
}

Perform an upgrade

POST _plugins/_security/api/_upgrade_perform
200 {
  "status" : "OK",
  "upgrades" : {
    "roles" : {
      "add" : [ "flow_framework_full_access" ],
      "modify" : [ "flow_framework_read_access" ]
    }
  }
}

Perform an upgrade when unneeded

POST _plugins/_security/api/_upgrade_perform
400 {
   "status": "BAD_REQUEST",
   "message": "Unable to upgrade, no differences found in 'roles' config"
}

Issues Resolved

Testing

New unit test and integration test cases

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2.14.0 Issues and PRs related to version 2.14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants