mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-19 17:12:47 +01:00
Add an E2E test that SQL connection string login skips the Portal Backend
Nothing asserted the defining behavior of the direct login path, so reverting the short-circuit in connectWithConnectionString would have gone unnoticed. The listener filters on the connectionstring route so it covers both generatetoken and accessinputmetadata, and leaves the account restriction check alone since that still runs for every API.
This commit is contained in:
@@ -36,7 +36,7 @@ const App: React.FunctionComponent = () => {
|
||||
// For handling encrypted portal tokens sent via query paramter
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const [encryptedToken, setEncryptedToken] = React.useState<string>(params && params.get("key"));
|
||||
// Encrypted token logins resolve the account metadata through the Portal Backend, while SQL/Tables/Gremlin
|
||||
// Encrypted token logins resolve the account metadata through the Portal Backend, while SQL/Table/Gremlin
|
||||
// connection-string logins derive it client-side, so both paths write to the same value.
|
||||
const [accountMetadata, setAccountMetadata] = React.useState<AccessInputMetadata>();
|
||||
|
||||
|
||||
@@ -85,9 +85,6 @@ describe("ConnectionStringParser", () => {
|
||||
|
||||
expect(metadata.accountName).toBe(mockAccountName);
|
||||
expect(metadata.apiKind).toBe(DataModels.ApiKind.Cassandra);
|
||||
// Cassandra still uses the Portal Backend proxy, so no client-side endpoints are constructed.
|
||||
expect(metadata.documentEndpoint).toBeUndefined();
|
||||
expect(metadata.apiEndpoint).toBeUndefined();
|
||||
});
|
||||
|
||||
it("should fail to parse an invalid connection string", () => {
|
||||
|
||||
Reference in New Issue
Block a user