mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 17:12:47 +01:00
Refer to the Table API as Table in comments
The comments added by this branch alternated between Table and Tables when naming the API alongside SQL and Gremlin. TablesDB is left alone since that is the literal database name, as is the plural noun where it refers to actual tables.
This commit is contained in:
@@ -71,7 +71,7 @@ const App: React.FunctionComponent = () => {
|
||||
|
||||
const metadata = parseConnectionString(connStr);
|
||||
if (metadata && isDirectConnectionStringLoginApi(metadata.apiKind)) {
|
||||
// SQL, Tables, and Gremlin sign data-plane requests client-side with the account key, so we skip
|
||||
// SQL, Table, and Gremlin sign data-plane requests client-side with the account key, so we skip
|
||||
// the Portal Backend proxy and use the metadata derived from the connection string directly.
|
||||
setAccountMetadata(metadata);
|
||||
setAuthType(AuthType.ConnectionString);
|
||||
|
||||
@@ -14,12 +14,12 @@ export interface AAD {
|
||||
|
||||
export interface ConnectionString {
|
||||
authType: AuthType.ConnectionString;
|
||||
// SQL, Tables, and Gremlin sign data-plane requests client-side with the master key and do not need the
|
||||
// SQL, Table, and Gremlin sign data-plane requests client-side with the master key and do not need the
|
||||
// proxies, so they carry no encrypted token. Mongo and Cassandra still use the encrypted
|
||||
// token because their operations go through the proxies.
|
||||
encryptedToken?: string;
|
||||
encryptedTokenMetadata: AccessInputMetadata;
|
||||
// Master key is used for the client-side signing path (SQL, Tables, Gremlin). Mongo/Cassandra leave it undefined.
|
||||
// Master key is used for the client-side signing path (SQL, Table, Gremlin). Mongo/Cassandra leave it undefined.
|
||||
masterKey?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ export const ConnectExplorer: React.FunctionComponent<Props> = ({
|
||||
|
||||
const metadata = parseConnectionString(connectionString);
|
||||
if (metadata && isDirectConnectionStringLoginApi(metadata.apiKind)) {
|
||||
// SQL, Tables, and Gremlin sign data-plane requests client-side with the account key, so
|
||||
// SQL, Table, and Gremlin sign data-plane requests client-side with the account key, so
|
||||
// we skip the Portal Backend proxy and use the metadata parsed from the connection string.
|
||||
setAccountMetadata(metadata);
|
||||
setAuthType(AuthType.ConnectionString);
|
||||
|
||||
@@ -62,7 +62,7 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
expect(metadata.apiKind).toBe(DataModels.ApiKind.Table);
|
||||
// Tables data operations go through the document endpoint, which is constructed from the account name.
|
||||
// Table data operations go through the document endpoint, which is constructed from the account name.
|
||||
expect(metadata.documentEndpoint).toBe(`https://${mockAccountName}.documents.azure.com:443/`);
|
||||
expect(metadata.apiEndpoint).toBeUndefined();
|
||||
});
|
||||
|
||||
@@ -46,7 +46,7 @@ export function extractMasterKeyFromDirectLoginConnectionString(connectionString
|
||||
return (matchedParts && matchedParts.length > 1 && matchedParts[1]) || undefined;
|
||||
}
|
||||
|
||||
// SQL, Tables, and Gremlin can sign data-plane requests client-side with the account key, so they do
|
||||
// SQL, Table, and Gremlin can sign data-plane requests client-side with the account key, so they do
|
||||
// not need the Portal Backend proxy for connection-string login. Mongo and Cassandra still require the proxy.
|
||||
export function isDirectConnectionStringLoginApi(apiKind: ApiKind): boolean {
|
||||
return apiKind === ApiKind.SQL || apiKind === ApiKind.Table || apiKind === ApiKind.Graph;
|
||||
|
||||
@@ -468,7 +468,7 @@ function configureHostedWithConnectionString(config: ConnectionString): Explorer
|
||||
tags: {},
|
||||
};
|
||||
if (config.masterKey && !config.encryptedToken) {
|
||||
// Direct client-side signing path (SQL, Tables, Gremlin). Requests are signed locally with the
|
||||
// Direct client-side signing path (SQL, Table, Gremlin). Requests are signed locally with the
|
||||
// account key via the Cosmos client's tokenProvider, so no Portal Backend proxy or encrypted token
|
||||
// is required.
|
||||
updateUserContext({
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
subscriptionId,
|
||||
} from "../fx";
|
||||
|
||||
// Tables API accounts store tables in a fixed "TablesDB" database, with each table as a container.
|
||||
// Table API accounts store tables in a fixed "TablesDB" database, with each table as a container.
|
||||
const databaseId = "TablesDB";
|
||||
const tableId = generateUniqueName("table");
|
||||
const partitionKey = "testpartition";
|
||||
@@ -56,7 +56,7 @@ test.describe("Tables account using connection string login", () => {
|
||||
accountName,
|
||||
);
|
||||
|
||||
// Tables sign data-plane requests client-side with the account key, so no encrypted token is issued.
|
||||
// Table accounts sign data-plane requests client-side with the account key, so no encrypted token is issued.
|
||||
const connectionString = connectionStrings.find((cs) => cs.type === "Table")?.connectionString;
|
||||
|
||||
await page.goto("https://localhost:1234/hostedExplorer.html");
|
||||
|
||||
Reference in New Issue
Block a user