mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 17:30:46 +00:00
Support data plane RBAC for Gremlin API (#2182)
* Refactor logic for determining if we should use data plane RBAC to a common function. * Support RBAC for gremlin API. * Refactor to use common function. * Fix unit tests. * Move test function inside test scope. * Minor clean ups. * Reinstate utf8ToB64 function in case this breaks a corner case.
This commit is contained in:
@@ -91,5 +91,5 @@ export const getItemName = (): string => {
|
||||
};
|
||||
|
||||
export const isDataplaneRbacSupported = (apiType: string): boolean => {
|
||||
return apiType === "SQL" || apiType === "Tables";
|
||||
return apiType === "SQL" || apiType === "Tables" || apiType === "Gremlin";
|
||||
};
|
||||
|
||||
@@ -104,7 +104,7 @@ describe("AuthorizationUtils", () => {
|
||||
|
||||
it("should return true if dataPlaneRbacEnabled is set to true and API supports RBAC", () => {
|
||||
setAadDataPlane(false);
|
||||
["SQL", "Tables"].forEach((type) => {
|
||||
["SQL", "Tables", "Gremlin"].forEach((type) => {
|
||||
updateUserContext({
|
||||
dataPlaneRbacEnabled: true,
|
||||
apiType: type as ApiType,
|
||||
@@ -115,7 +115,7 @@ describe("AuthorizationUtils", () => {
|
||||
|
||||
it("should return false if dataPlaneRbacEnabled is set to true and API does not support RBAC", () => {
|
||||
setAadDataPlane(false);
|
||||
["Mongo", "Gremlin", "Cassandra", "Postgres", "VCoreMongo"].forEach((type) => {
|
||||
["Mongo", "Cassandra", "Postgres", "VCoreMongo"].forEach((type) => {
|
||||
updateUserContext({
|
||||
dataPlaneRbacEnabled: true,
|
||||
apiType: type as ApiType,
|
||||
|
||||
Reference in New Issue
Block a user