Skip to content

Commit

Permalink
refactor: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
teodora-sandu committed Apr 29, 2024
1 parent abc45f9 commit 4eaa41b
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/snyk/common/configuration/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export interface IConfiguration {
source: string;

authHost: string;
baseApiUrl: string;

getToken(): Promise<string | undefined>;

Expand Down Expand Up @@ -97,8 +96,6 @@ export interface IConfiguration {

isFedramp: boolean;

analyticsPermitted: boolean;

severityFilter: SeverityFilter;

scanningMode: string | undefined;
Expand All @@ -117,8 +114,6 @@ export class Configuration implements IConfiguration {
private readonly defaultSnykCodeBaseURL = 'https://deeproxy.snyk.io';
private readonly defaultAuthHost = 'https://snyk.io';
private readonly defaultOssApiEndpoint = `${this.defaultAuthHost}/api/v1`;
private readonly defaultBaseApiHost = 'https://api.snyk.io';
private readonly analyticsPermittedEnvironments = { 'app.snyk.io': true, 'app.us.snyk.io': true };

constructor(private processEnv: NodeJS.ProcessEnv = process.env, private workspace: IVSCodeWorkspace) {}

Expand Down Expand Up @@ -204,13 +199,6 @@ export class Configuration implements IConfiguration {
return `${hostnameParts[2]}.${hostnameParts[3]}`.includes('snykgov.io');
}

get analyticsPermitted(): boolean {
if (!this.customEndpoint) return true;

const hostname = new URL(this.customEndpoint).hostname;
return hostname in this.analyticsPermittedEnvironments;
}

get snykOssApiEndpoint(): string {
if (this.customEndpoint) {
return this.customEndpoint; // E.g. https://app.eu.snyk.io/api
Expand Down Expand Up @@ -292,10 +280,6 @@ export class Configuration implements IConfiguration {
return Configuration.source;
}

get baseApiUrl(): string {
return this.defaultBaseApiHost;
}

getFeaturesConfiguration(): FeaturesConfiguration {
const ossEnabled = this.workspace.getConfiguration<boolean>(
CONFIGURATION_IDENTIFIER,
Expand Down

0 comments on commit 4eaa41b

Please sign in to comment.