-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RHOAIENG-11010] Use a more secure role for KServe InferenceService a…
…ccess (#3198) * Conditionally use specific role for viewing inferenceservices only for KServe Signed-off-by: Mike Turley <mike.turley@alum.cs.umass.edu> * Handle migration of old user data Signed-off-by: Mike Turley <mike.turley@alum.cs.umass.edu> * Update tests Signed-off-by: Mike Turley <mike.turley@alum.cs.umass.edu> * fix incorrect order of params, update tests Signed-off-by: gitdallas <5322142+gitdallas@users.noreply.github.com> * Add missing rules to service account role Signed-off-by: Mike Turley <mike.turley@alum.cs.umass.edu> --------- Signed-off-by: Mike Turley <mike.turley@alum.cs.umass.edu> Signed-off-by: gitdallas <5322142+gitdallas@users.noreply.github.com> Co-authored-by: gitdallas <5322142+gitdallas@users.noreply.github.com>
- Loading branch information
Showing
15 changed files
with
628 additions
and
90 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { genUID } from '~/__mocks__/mockUtils'; | ||
import { KnownLabels, ResourceRule, RoleKind } from '~/k8sTypes'; | ||
|
||
type MockResourceConfigType = { | ||
name?: string; | ||
namespace?: string; | ||
rules?: ResourceRule[]; | ||
roleRefName?: string; | ||
uid?: string; | ||
modelRegistryName?: string; | ||
isProjectSubject?: boolean; | ||
}; | ||
|
||
export const mockRoleK8sResource = ({ | ||
name = 'test-name-view', | ||
namespace = 'test-project', | ||
rules = [], | ||
uid = genUID('role'), | ||
}: MockResourceConfigType): RoleKind => ({ | ||
kind: 'Role', | ||
apiVersion: 'rbac.authorization.k8s.io/v1', | ||
metadata: { | ||
name, | ||
namespace, | ||
uid, | ||
creationTimestamp: '2023-02-14T21:43:59Z', | ||
labels: { | ||
[KnownLabels.DASHBOARD_RESOURCE]: 'true', | ||
}, | ||
}, | ||
rules, | ||
}); |
Oops, something went wrong.