Skip to content

Commit

Permalink
CORE-18168: Add Kafka payload and config to support changing user pas…
Browse files Browse the repository at this point in the history
…sword (#1356)

Creates
-ChangeUserPasswordOtherRequest.avsc
-ChangeUserPasswordSelfRequest.avsc
These will be used to allow users to change their own password, and for an admin to change a particular user's password.

This also adds new config settings related to password expiry, specifically, default values for how long a password should last before expiring depending on whether a user or an admin changed the password.
  • Loading branch information
Tom-Fitzpatrick authored Nov 23, 2023
1 parent 3c09b7b commit 77ff03a
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
"name": "request",
"type": [
"net.corda.data.permissions.management.user.CreateUserRequest",
"net.corda.data.permissions.management.user.ChangeUserPasswordSelfRequest",
"net.corda.data.permissions.management.user.ChangeUserPasswordOtherRequest",
"net.corda.data.permissions.management.user.AddRoleToUserRequest",
"net.corda.data.permissions.management.user.RemoveRoleFromUserRequest",
"net.corda.data.permissions.management.role.CreateRoleRequest",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"type": "record",
"name": "ChangeUserPasswordOtherRequest",
"namespace": "net.corda.data.permissions.management.user",
"fields": [
{
"name": "requestedBy",
"type": "string"
},
{
"name": "username",
"type": "string"
},
{
"name": "saltValue",
"type": [ "null", "string" ]
},
{
"name": "hashedNewPassword",
"type": "string"
},
{
"name": "passwordExpiry",
"type": [
"null",
{
"type": "long",
"logicalType": "timestamp-millis"
}
],
"doc": "Time ([Instant]) in milliseconds when the user's password expires."
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "record",
"name": "ChangeUserPasswordSelfRequest",
"namespace": "net.corda.data.permissions.management.user",
"fields": [
{
"name": "requestedBy",
"type": "string"
},
{
"name": "saltValue",
"type": [ "null", "string" ]
},
{
"name": "hashedNewPassword",
"type": "string"
},
{
"name": "passwordExpiry",
"type": [
"null",
{
"type": "long",
"logicalType": "timestamp-millis"
}
],
"doc": "Time ([Instant]) in milliseconds when the user's password expires."
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ private ConfigKeys() {
public static final String REST_AZUREAD_TENANT_ID = "sso.azureAd.tenantId";
public static final String REST_WEBSOCKET_CONNECTION_IDLE_TIMEOUT_MS = "websocket.idleTimeoutMs";

// RBAC
public static final String RBAC_USER_PASSWORD_CHANGE_EXPIRY = "password.userPasswordChangeExpiry";
public static final String RBAC_ADMIN_PASSWORD_CHANGE_EXPIRY = "password.adminPasswordChangeExpiry";
public static final String RBAC_PASSWORD_EXPIRY_WARNING_WINDOW = "password.passwordExpiryWarningWindow";

// Secrets Service
//
// SECRETS_TYPE control which secrets service implementation will be selected.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://corda.r3.com/net/corda/schema/configuration/rbac/1.0/corda.rbac.json",
"title": "Corda RBAC Configuration Schema",
"description": "Configuration schema for the Roll Based Access section.",
"type": "object",
"default": {},
"properties": {
"password": {
"description": "Settings for passwords.",
"type": "object",
"default": {},
"userPasswordChangeExpiry": {
"description": "The amount of time (days) before the password must be updated again after user password change.",
"type": "integer",
"minimum": 30,
"default": 90
},
"adminPasswordChangeExpiry": {
"description": "The amount of time (days) before the password must be updated again after admin password change",
"type": "integer",
"minimum": 1,
"default": 7
},
"passwordExpiryWarningWindow": {
"description": "The time (days) before a password expires in which we begin to offer warnings about upcoming expiry.",
"type": "integer",
"default": 30
}
}
}
}

0 comments on commit 77ff03a

Please sign in to comment.