Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update semver and a few other dependencies, removes unused code - VSCODE-436, VSCODE-437 #556

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ syntaxes
CHANGELOG.md
README.md
constants.json
.sbom
10 changes: 10 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-SEMVER-3247795:
- '*':
reason: "Security patches released for semver 5.x (5.7.2) and 6.x (6.3.1) are not yet known to Snyk which is why we would like to ignore this vulnerability until the mentioned expiry."
expires: 2023-08-11T09:00:55.553Z
created: 2023-07-12T09:00:55.557Z
patch: {}
27,945 changes: 11,234 additions & 16,711 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,7 @@
"@fortawesome/react-fontawesome": "^0.2.0",
"@iconify-icons/codicon": "^1.2.25",
"@iconify/react": "^1.1.4",
"@leafygreen-ui/logo": "^6.3.0",
"@leafygreen-ui/toggle": "^7.0.5",
"@leafygreen-ui/logo": "^8.0.4",
"@mongodb-js/mongodb-constants": "^0.6.5",
"@mongosh/browser-runtime-electron": "^1.10.1",
"@mongosh/i18n": "^1.10.1",
Expand Down
2 changes: 0 additions & 2 deletions src/test/suite/utils/links.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ const expectedLinks = {
'https://www.mongodb.com/docs/mongodb-shell/reference/data-types/?utm_source=vscode&utm_medium=product#hi',
systemVariableDocs:
'https://www.mongodb.com/docs/manual/reference/aggregation-variables/?utm_source=vscode&utm_medium=product#mongodb-variable-variable.hi',
kerberosPrincipalDocs:
'https://docs.mongodb.com/manual/core/kerberos/?utm_source=vscode&utm_medium=product#principals',
ldapDocs:
'https://docs.mongodb.com/manual/core/security-ldap/?utm_source=vscode&utm_medium=product',
authDatabaseDocs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ describe('Authentication Component Test Suite', () => {
<Authentication
authStrategy={AUTH_STRATEGIES.NONE}
isValid
kerberosCanonicalizeHostname
onAuthStrategyChanged={(): void => {}}
/>
);
Expand All @@ -28,7 +27,6 @@ describe('Authentication Component Test Suite', () => {
<Authentication
authStrategy={AUTH_STRATEGIES.MONGODB}
isValid
kerberosCanonicalizeHostname
onAuthStrategyChanged={(): void => {}}
/>
);
Expand All @@ -40,7 +38,6 @@ describe('Authentication Component Test Suite', () => {
<Authentication
authStrategy={AUTH_STRATEGIES['SCRAM-SHA-256']}
isValid
kerberosCanonicalizeHostname
onAuthStrategyChanged={(): void => {}}
/>
);
Expand Down
2 changes: 0 additions & 2 deletions src/utils/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ const LINKS = {
systemVariableDocs: (name: string) => {
return `https://www.mongodb.com/docs/manual/reference/aggregation-variables/#mongodb-variable-variable.${name}`;
},
kerberosPrincipalDocs:
'https://docs.mongodb.com/manual/core/kerberos/#principals',
ldapDocs: 'https://docs.mongodb.com/manual/core/security-ldap/',
authDatabaseDocs:
'https://docs.mongodb.com/manual/core/security-users/#user-authentication-database',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import AUTH_STRATEGIES, {
AuthStrategies,
} from '../../../../connection-model/constants/auth-strategies';
import FormGroup from '../../../form/form-group';
import Kerberos from './kerberos';
import LDAP from './ldap';
import MongoDBAuth from './mongodb-authentication';
import ScramSha256 from './scram-sha-256';
Expand All @@ -20,10 +19,6 @@ import RadioBoxGroup from '../../../form/radio-box-group/radio-box-group';
type StateProps = {
authStrategy: AUTH_STRATEGIES;
isValid: boolean;
kerberosCanonicalizeHostname: boolean;
kerberosPassword?: string;
kerberosPrincipal?: string;
kerberosServiceName?: string;
ldapPassword?: string;
ldapUsername?: string;
mongodbDatabaseName?: string;
Expand Down Expand Up @@ -56,24 +51,6 @@ export class Authentication extends React.Component<
renderAuthStrategy(): React.ReactNode {
const { authStrategy, isValid } = this.props;

if (authStrategy === AUTH_STRATEGIES.KERBEROS) {
const {
kerberosCanonicalizeHostname,
kerberosPassword,
kerberosPrincipal,
kerberosServiceName,
} = this.props;

return (
<Kerberos
isValid={isValid}
kerberosCanonicalizeHostname={kerberosCanonicalizeHostname}
kerberosPassword={kerberosPassword}
kerberosPrincipal={kerberosPrincipal}
kerberosServiceName={kerberosServiceName}
/>
);
}
if (authStrategy === AUTH_STRATEGIES.LDAP) {
const { ldapPassword, ldapUsername } = this.props;

Expand Down Expand Up @@ -142,11 +119,6 @@ const mapStateToProps = (state: AppState): StateProps => {
return {
authStrategy: state.currentConnection.authStrategy,
isValid: state.isValid,
kerberosCanonicalizeHostname:
state.currentConnection.kerberosCanonicalizeHostname,
kerberosPassword: state.currentConnection.kerberosPassword,
kerberosPrincipal: state.currentConnection.kerberosPrincipal,
kerberosServiceName: state.currentConnection.kerberosServiceName,
ldapPassword: state.currentConnection.ldapPassword,
ldapUsername: state.currentConnection.ldapUsername,
mongodbDatabaseName: state.currentConnection.mongodbDatabaseName,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ class LDAP extends React.Component<props> {
this.props.onLDAPUsernameChanged(evt.target.value.trim());
};

/**
* Render the kerberos component.
*
* @returns {React.Component} The component.
*/
render(): React.ReactNode {
const { isValid, ldapPassword, ldapUsername } = this.props;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,11 @@ type props = {
x509Username?: string;
} & DispatchProps;

/**
* The kerberos auth role component.
*/
class X509 extends React.Component<props> {
/**
* Handle the username change.
*
* @param {Event} evt - The event.
*/
onUsernameChanged = (evt): void => {
this.props.onX509UsernameChanged(evt.target.value.trim());
};

/**
* Render the kerberos component.
*
* @returns {React.Component} The component.
*/
render(): React.ReactNode {
const { x509Username } = this.props;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
.mdb-logo-svg {
.mdb-logo-container {
margin-top: 19px;
margin-bottom: 4px;

path {
fill: var(--mongodb-green);
}
}
10 changes: 6 additions & 4 deletions src/views/webview-app/components/mongodb-logo/mongodb-logo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import { MongoDBLogo as LeafyGreenMongoDBLogo } from '@leafygreen-ui/logo';

import styles from './mongodb-logo.less';

class MongoDBLogo extends React.PureComponent {
render(): React.ReactNode {
return <LeafyGreenMongoDBLogo className={styles['mdb-logo-svg']} />;
}
function MongoDBLogo() {
return (
<div className={styles['mdb-logo-container']}>
<LeafyGreenMongoDBLogo color="green-base" />
</div>
);
}

export default MongoDBLogo;
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ export default {
'SCRAM-SHA-256': 'SCRAM-SHA-256',
'MONGODB-CR': 'MONGODB',
'MONGODB-X509': 'X509',
GSSAPI: 'KERBEROS',
SSPI: 'KERBEROS',
PLAIN: 'LDAP',
LDAP: 'LDAP',
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ export enum AUTH_STRATEGY_VALUES {
* @see http://bit.ly/mongodb-node-driver-x509
*/
X509 = 'X509',
/**
* @enterprise
* @see http://bit.ly/mongodb-node-driver-kerberos
*/
KERBEROS = 'KERBEROS',
/**
* @enterprise
* @see http://bit.ly/mongodb-node-driver-ldap
Expand All @@ -45,11 +40,6 @@ export const AuthStrategies: AuthStrategy[] = [
id: AUTH_STRATEGY_VALUES['SCRAM-SHA-256'],
title: 'SCRAM-SHA-256',
},
// Currently disabled.
// {
// id: AUTH_STRATEGY_VALUES.KERBEROS,
// title: 'Kerberos'
// },
{
id: AUTH_STRATEGY_VALUES.LDAP,
title: 'LDAP',
Expand Down
Loading