-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename Admin Role to SystemAdmin for Clarity #1054
base: main
Are you sure you want to change the base?
Conversation
Motivation: The term "Admin" does not clearly convey its purpose as a system-wide administrator role, as discussed in [issue line#1048](line#1048). Renaming this role improves clarity for users and developers. Modifications: - Renamed all "Admin" to "SystemAdmin" across the codebase. - Updated `MetadataService.updateTokenLevel()` to avoid directly accessing the `admin` property. Result: - The role name "Admin" has been replaced with "SystemAdmin".
@@ -86,7 +86,7 @@ public final class AuthConfig { | |||
@JsonCreator | |||
public AuthConfig( | |||
@JsonProperty("factoryClassName") String factoryClassName, | |||
@JsonProperty("administrators") @Nullable Set<String> administrators, | |||
@JsonProperty("systemAdministrators") @Nullable Set<String> systemAdministrators, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't implement this in a backward-compatible way because the configuration file raises an exception at startup. Please let me know if you have a different opinion on this. 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
@@ -126,7 +126,7 @@ public final <T> CompletableFuture<T> execute(Command<T> command) { | |||
if (!isStarted()) { | |||
throw new ReadOnlyException("running in read-only mode. command: " + command); | |||
} | |||
if (!writable && !(command instanceof AdministrativeCommand)) { | |||
if (!writable && !(command instanceof SystemAdministrativeCommand)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checked that the superclass [System]AdministrativeCommand
isn't exposed in the JSON in any way
*/ | ||
@JsonProperty | ||
public boolean isAdmin() { | ||
return isAdmin; | ||
public boolean isSystemAdmin() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note:
- While releasing, if a user tries to access a token via UI served by old servers to a new server he/she may encounter errors.
- If a new token is registered while releasing, old servers may not be able to access it
- Regarding rollback plan: if a new token is registered we need to clean up the token before performing rollback. Having said this, I'm not sure if there is an easy way to detect this at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While releasing, if a user tries to access a token via UI served by old servers to a new server he/she may encounter errors.
That's correct. 👍 We need to let them refresh the page after finishing the rolling restart.
If a new token is registered while releasing, old servers may not be able to access it
That's correct. 👍 I thought it should be okay, but it probably shouldn't be. 😓
Let me create a separate commit to solve this issue.
Regarding rollback plan:
I'm implementing a client that migrates admin
to systemAdmin
.
Let me also implement the client the vise-versa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motivation To ensure smooth compatibility with line#1054, the `Token` structure needs an update to support changes in `admin` property. Modifications: - Enhanced the Token deserializer to accept both `admin` and `systemAdmin` properties, ensuring backward compatibility. - Updated `MetadataService.updateTokenLevel()` to avoid direct access to the `admin` property. Result: - The `Token` structure now supports the upcoming changes, allowing seamless updates with line#1054.
Motivation To ensure smooth compatibility with #1054, the `Token` structure needs an update to support changes in `admin` property. Modifications: - Enhanced the Token deserializer to accept both `admin` and `systemAdmin` properties, ensuring backward compatibility. - Updated `MetadataService.updateTokenLevel()` to avoid direct access to the `admin` property. Result: - The `Token` structure now supports the upcoming changes, allowing seamless updates with #1054.
Motivation:
The term "Admin" does not clearly convey its purpose as a system-wide administrator role, as discussed in issue #1048. Renaming this role improves clarity for users and developers.
Modifications:
MetadataService.updateTokenLevel()
to avoid directly accessing theadmin
property.Result:
authentication.administrators
in dogma.json is nowauthentication.systemAdministrators
.systemAdmin
property instead ofadmin
when creating a token via REST API:SYSTEMADMIN
instead ofadmin
when changing the token level: