-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SM-1293] Add the ability to fetch a secret's access policies (#9463)
* Update response models * Update view models * Update access policy service * update ap item types to use new models * add convertToSecretAccessPolicies * Add unit tests
- Loading branch information
1 parent
769d67a
commit 7acc13c
Showing
22 changed files
with
896 additions
and
404 deletions.
There are no files selected for viewing
32 changes: 7 additions & 25 deletions
32
...license/bit-web/src/app/secrets-manager/models/view/access-policies/access-policy.view.ts
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 |
---|---|---|
@@ -1,44 +1,26 @@ | ||
export class BaseAccessPolicyView { | ||
id: string; | ||
class BaseAccessPolicyView { | ||
read: boolean; | ||
write: boolean; | ||
creationDate: string; | ||
revisionDate: string; | ||
} | ||
|
||
export class UserProjectAccessPolicyView extends BaseAccessPolicyView { | ||
export class UserAccessPolicyView extends BaseAccessPolicyView { | ||
organizationUserId: string; | ||
organizationUserName: string; | ||
grantedProjectId: string; | ||
userId: string; | ||
currentUser: boolean; | ||
} | ||
|
||
export class UserServiceAccountAccessPolicyView extends BaseAccessPolicyView { | ||
organizationUserId: string; | ||
organizationUserName: string; | ||
grantedServiceAccountId: string; | ||
userId: string; | ||
currentUser: boolean; | ||
} | ||
|
||
export class GroupProjectAccessPolicyView extends BaseAccessPolicyView { | ||
groupId: string; | ||
groupName: string; | ||
grantedProjectId: string; | ||
currentUserInGroup: boolean; | ||
} | ||
|
||
export class GroupServiceAccountAccessPolicyView extends BaseAccessPolicyView { | ||
export class GroupAccessPolicyView extends BaseAccessPolicyView { | ||
groupId: string; | ||
groupName: string; | ||
grantedServiceAccountId: string; | ||
currentUserInGroup: boolean; | ||
} | ||
|
||
export class ServiceAccountProjectAccessPolicyView extends BaseAccessPolicyView { | ||
export class ServiceAccountAccessPolicyView extends BaseAccessPolicyView { | ||
serviceAccountId: string; | ||
serviceAccountName: string; | ||
} | ||
|
||
export class GrantedProjectAccessPolicyView extends BaseAccessPolicyView { | ||
grantedProjectId: string; | ||
grantedProjectName: string; | ||
} |
6 changes: 3 additions & 3 deletions
6
...rc/app/secrets-manager/models/view/access-policies/project-people-access-policies.view.ts
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { GroupProjectAccessPolicyView, UserProjectAccessPolicyView } from "./access-policy.view"; | ||
import { GroupAccessPolicyView, UserAccessPolicyView } from "./access-policy.view"; | ||
|
||
export class ProjectPeopleAccessPoliciesView { | ||
userAccessPolicies: UserProjectAccessPolicyView[]; | ||
groupAccessPolicies: GroupProjectAccessPolicyView[]; | ||
userAccessPolicies: UserAccessPolicyView[]; | ||
groupAccessPolicies: GroupAccessPolicyView[]; | ||
} |
4 changes: 2 additions & 2 deletions
4
...rets-manager/models/view/access-policies/project-service-accounts-access-policies.view.ts
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { ServiceAccountProjectAccessPolicyView } from "./access-policy.view"; | ||
import { ServiceAccountAccessPolicyView } from "./access-policy.view"; | ||
|
||
export class ProjectServiceAccountsAccessPoliciesView { | ||
serviceAccountAccessPolicies: ServiceAccountProjectAccessPolicyView[]; | ||
serviceAccountAccessPolicies: ServiceAccountAccessPolicyView[]; | ||
} |
11 changes: 11 additions & 0 deletions
11
...it-web/src/app/secrets-manager/models/view/access-policies/secret-access-policies.view.ts
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,11 @@ | ||
import { | ||
GroupAccessPolicyView, | ||
UserAccessPolicyView, | ||
ServiceAccountAccessPolicyView, | ||
} from "./access-policy.view"; | ||
|
||
export class SecretAccessPoliciesView { | ||
userAccessPolicies: UserAccessPolicyView[]; | ||
groupAccessPolicies: GroupAccessPolicyView[]; | ||
serviceAccountAccessPolicies: ServiceAccountAccessPolicyView[]; | ||
} |
8 changes: 4 additions & 4 deletions
8
.../app/secrets-manager/models/view/access-policies/service-account-granted-policies.view.ts
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import { ServiceAccountProjectAccessPolicyView } from "./access-policy.view"; | ||
import { GrantedProjectAccessPolicyView } from "./access-policy.view"; | ||
|
||
export class ServiceAccountGrantedPoliciesView { | ||
grantedProjectPolicies: ServiceAccountProjectPolicyPermissionDetailsView[]; | ||
grantedProjectPolicies: GrantedProjectPolicyPermissionDetailsView[]; | ||
} | ||
|
||
export class ServiceAccountProjectPolicyPermissionDetailsView { | ||
accessPolicy: ServiceAccountProjectAccessPolicyView; | ||
export class GrantedProjectPolicyPermissionDetailsView { | ||
accessPolicy: GrantedProjectAccessPolicyView; | ||
hasPermission: boolean; | ||
} |
9 changes: 3 additions & 6 deletions
9
...ecrets-manager/models/view/access-policies/service-account-people-access-policies.view.ts
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { | ||
GroupServiceAccountAccessPolicyView, | ||
UserServiceAccountAccessPolicyView, | ||
} from "./access-policy.view"; | ||
import { GroupAccessPolicyView, UserAccessPolicyView } from "./access-policy.view"; | ||
|
||
export class ServiceAccountPeopleAccessPoliciesView { | ||
userAccessPolicies: UserServiceAccountAccessPolicyView[]; | ||
groupAccessPolicies: GroupServiceAccountAccessPolicyView[]; | ||
userAccessPolicies: UserAccessPolicyView[]; | ||
groupAccessPolicies: GroupAccessPolicyView[]; | ||
} |
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
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
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
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.