-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Teletraan AuthN and AuthZ implementation
commit-id:bf5d6dfa
- Loading branch information
1 parent
b1143e4
commit b3be719
Showing
83 changed files
with
2,267 additions
and
1,727 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 0 additions & 74 deletions
74
deploy-service/common/src/main/java/com/pinterest/deployservice/bean/Resource.java
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
deploy-service/common/src/main/java/com/pinterest/deployservice/bean/Role.java
This file was deleted.
Oops, something went wrong.
65 changes: 65 additions & 0 deletions
65
...ervice/common/src/main/java/com/pinterest/deployservice/bean/TeletraanPrincipalRoles.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Copyright (c) 2024, Pinterest Inc. All rights reserved. | ||
*/ | ||
package com.pinterest.deployservice.bean; | ||
|
||
import com.pinterest.teletraan.universal.security.bean.RoleEnum; | ||
import com.pinterest.teletraan.universal.security.bean.ValueBasedRole; | ||
|
||
|
||
/** | ||
* READER: | ||
* Default role, everyone who is able to use Teletraan has READER access. | ||
* PINGER: | ||
* Role required to ping server. | ||
* PUBLISHER: | ||
* Role required to publish artifacts. | ||
* OPERATOR: | ||
* Role where user can modify a specific environment's config and | ||
* perform deploy related actions. | ||
* ADMIN: | ||
* Role that has the same environment specific privileges as OPERATOR | ||
* plus the ability specify new OPERATORS and ADMINs for said environment. | ||
* When a new environment is created the creating user is the designated the | ||
* first ADMIN. | ||
*/ | ||
public enum TeletraanPrincipalRoles implements RoleEnum<ValueBasedRole> { | ||
READ(-1), | ||
READER(0), // legacy | ||
PINGER(1), // legacy | ||
PUBLISH(1), | ||
PUBLISHER(1), // legacy | ||
EXECUTE(9), | ||
WRITE(9), | ||
DELETE(9), | ||
OPERATOR(10), // legacy | ||
ADMIN(20); | ||
|
||
public class Names { | ||
private Names() {} | ||
public static final String ADMIN = "ADMIN"; | ||
public static final String READER = "READER"; | ||
public static final String OPERATOR = "OPERATOR"; | ||
public static final String PINGER = "PINGER"; | ||
|
||
public static final String READ = "READ"; | ||
public static final String WRITE = "WRITE"; | ||
public static final String EXECUTE = "EXECUTE"; | ||
public static final String DELETE = "DELETE"; | ||
public static final String PUBLISH = "PUBLISH"; | ||
} | ||
|
||
private ValueBasedRole role; | ||
|
||
TeletraanPrincipalRoles(int value) { | ||
this.role = new ValueBasedRole(value); | ||
} | ||
|
||
public ValueBasedRole getRole() { | ||
return role; | ||
} | ||
|
||
public boolean isEqualOrSuperior(TeletraanPrincipalRoles otherRole) { | ||
return this.role.isEqualOrSuperior(otherRole.getRole()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.