Skip to content

[server/dash] Remove license RPCs/view WEB-214 #17342

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

Merged
merged 4 commits into from
Apr 24, 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
101 changes: 0 additions & 101 deletions components/dashboard/src/admin/License.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions components/dashboard/src/admin/admin.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,5 @@ export function getAdminSettingsMenu() {
title: "General",
link: ["/admin/settings"],
},
{
title: "License",
link: ["/admin/license"],
},
];
}
2 changes: 0 additions & 2 deletions components/dashboard/src/app/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const WorkspacesSearch = React.lazy(() => import(/* webpackPrefetch: true */ "..
const AdminSettings = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/Settings"));
const ProjectsSearch = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/ProjectsSearch"));
const TeamsSearch = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/TeamsSearch"));
const License = React.lazy(() => import(/* webpackPrefetch: true */ "../admin/License"));
const Usage = React.lazy(() => import(/* webpackPrefetch: true */ "../Usage"));
const UserOnboarding = React.lazy(() => import(/* webpackPrefetch: true */ "../onboarding/UserOnboarding"));

Expand Down Expand Up @@ -224,7 +223,6 @@ export const AppRoutes = () => {
<AdminRoute path="/admin/workspaces" component={WorkspacesSearch} />
<AdminRoute path="/admin/projects" component={ProjectsSearch} />
<AdminRoute path="/admin/blocked-repositories" component={BlockedRepositories} />
<AdminRoute path="/admin/license" component={License} />
<AdminRoute path="/admin/settings" component={AdminSettings} />

<Route path={["/", "/login"]} exact>
Expand Down
25 changes: 11 additions & 14 deletions components/dashboard/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { ConfettiContextProvider } from "./contexts/ConfettiContext";
import { FeatureFlagContextProvider } from "./contexts/FeatureFlagContext";
import { setupQueryClientProvider } from "./data/setup";
import "./index.css";
import { LicenseContextProvider } from "./license-context";
import { PaymentContextProvider } from "./payment-context";
import { ProjectContextProvider } from "./projects/project-context";
import { ThemeContextProvider } from "./theme-context";
Expand Down Expand Up @@ -68,19 +67,17 @@ const bootApp = () => {
<UserContextProvider>
<AdminContextProvider>
<PaymentContextProvider>
<LicenseContextProvider>
<ProjectContextProvider>
<ThemeContextProvider>
<BrowserRouter>
<StartWorkspaceModalContextProvider>
<FeatureFlagContextProvider>
<App />
</FeatureFlagContextProvider>
</StartWorkspaceModalContextProvider>
</BrowserRouter>
</ThemeContextProvider>
</ProjectContextProvider>
</LicenseContextProvider>
<ProjectContextProvider>
<ThemeContextProvider>
<BrowserRouter>
<StartWorkspaceModalContextProvider>
<FeatureFlagContextProvider>
<App />
</FeatureFlagContextProvider>
</StartWorkspaceModalContextProvider>
</BrowserRouter>
</ThemeContextProvider>
</ProjectContextProvider>
</PaymentContextProvider>
</AdminContextProvider>
</UserContextProvider>
Expand Down
22 changes: 0 additions & 22 deletions components/dashboard/src/license-context.tsx

This file was deleted.

3 changes: 1 addition & 2 deletions components/gitpod-protocol/src/gitpod-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import { AdminServer } from "./admin-protocol";
import { GitpodHostUrl } from "./util/gitpod-host-url";
import { WebSocketConnectionProvider } from "./messaging/browser/connection";
import { PermissionName } from "./permission";
import { LicenseService } from "./license-protocol";
import { Emitter } from "./util/event";
import { RemotePageMessage, RemoteTrackMessage, RemoteIdentifyMessage } from "./analytics";
import { IDEServer } from "./ide-protocol";
Expand All @@ -73,7 +72,7 @@ export interface GitpodClient {
}

export const GitpodServer = Symbol("GitpodServer");
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, LicenseService, IDEServer {
export interface GitpodServer extends JsonRpcServer<GitpodClient>, AdminServer, IDEServer {
// User related API
getLoggedInUser(): Promise<User>;
updateLoggedInUser(user: Partial<User>): Promise<User>;
Expand Down
1 change: 0 additions & 1 deletion components/gitpod-protocol/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export * from "./gitpod-service";
export * from "./util/disposable";
export * from "./util/event";
export * from "./util/queue";
export * from "./license-protocol";
export * from "./workspace-instance";
export * from "./permission";
export * from "./admin-protocol";
Expand Down
25 changes: 0 additions & 25 deletions components/gitpod-protocol/src/license-protocol.ts

This file was deleted.

5 changes: 0 additions & 5 deletions components/server/ee/src/workspace/gitpod-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import {
} from "@gitpod/ws-manager/lib";
import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
import { log, LogContext } from "@gitpod/gitpod-protocol/lib/util/logging";
import { LicenseValidationResult } from "@gitpod/gitpod-protocol/lib/license-protocol";
import { PrebuildManager } from "../prebuilds/prebuild-manager";
import { GuardedCostCenter, ResourceAccessGuard, ResourceAccessOp } from "../../../src/auth/resource-access";
import { BlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol";
Expand Down Expand Up @@ -206,10 +205,6 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
}
}

async validateLicense(ctx: TraceContext): Promise<LicenseValidationResult> {
return { valid: true };
}

goDurationToHumanReadable(goDuration: string): string {
const [, value, unit] = goDuration.match(/^(\d+)([mh])$/)!;
let duration = parseInt(value);
Expand Down
4 changes: 0 additions & 4 deletions components/server/src/auth/rate-limiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ const defaultFunctions: FunctionsConfig = {
adminGetProjectsBySearchTerm: { group: "default", points: 1 },
adminGetProjectById: { group: "default", points: 1 },
adminFindPrebuilds: { group: "default", points: 1 },
adminGetLicense: { group: "default", points: 1 },
adminGetSettings: { group: "default", points: 1 },
adminUpdateSettings: { group: "default", points: 1 },
adminGetTelemetryData: { group: "default", points: 1 },
Expand All @@ -172,9 +171,6 @@ const defaultFunctions: FunctionsConfig = {
adminAddUsageCreditNote: { group: "default", points: 1 },
adminGetUsageBalance: { group: "default", points: 1 },

validateLicense: { group: "default", points: 1 },
getLicenseInfo: { group: "default", points: 1 },

accessCodeSyncStorage: { group: "default", points: 1 },

accessHeadlessLogs: { group: "default", points: 1 },
Expand Down
25 changes: 0 additions & 25 deletions components/server/src/workspace/gitpod-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ import {
AdminModifyRoleOrPermissionRequest,
WorkspaceAndInstance,
} from "@gitpod/gitpod-protocol/lib/admin-protocol";
import {
GetLicenseInfoResult,
LicenseInfo,
LicenseValidationResult,
} from "@gitpod/gitpod-protocol/lib/license-protocol";
import { GitpodFileParser } from "@gitpod/gitpod-protocol/lib/gitpod-file-parser";
import { ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error";
import { Cancelable } from "@gitpod/gitpod-protocol/lib/util/cancelable";
Expand Down Expand Up @@ -3026,22 +3021,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
return await this.telemetryDataProvider.getTelemetryData();
}

async getLicenseInfo(): Promise<GetLicenseInfoResult> {
throw new ResponseError(ErrorCodes.EE_FEATURE, `Licensing is implemented in Gitpod's Enterprise Edition`);
}

async adminGetLicense(ctx: TraceContext): Promise<LicenseInfo> {
traceAPIParams(ctx, {});

await this.guardAdminAccess("adminGetLicense", {}, Permission.ADMIN_API);

const userCount = await this.userDB.getUserCount(true);

return {
userCount: userCount,
};
}

protected censorUser(user: User): User {
const res = { ...user };
delete res.additionalData;
Expand All @@ -3057,10 +3036,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable {
return res;
}

async validateLicense(ctx: TraceContext): Promise<LicenseValidationResult> {
throw new ResponseError(ErrorCodes.EE_FEATURE, `Licensing is implemented in Gitpod's Enterprise Edition`);
}

async getOwnAuthProviders(ctx: TraceContext): Promise<AuthProviderEntry[]> {
const redacted = (entry: AuthProviderEntry) => AuthProviderEntry.redact(entry);
let userId: string;
Expand Down
2 changes: 0 additions & 2 deletions install/installer/pkg/config/v1/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ Config defines the v1 version structure of the gitpod config file
|`authProviders[ ].name`|string|Y| ||
|`blockNewUsers.enabled`|bool|N| ||
|`blockNewUsers.passlist[ ]`|[]string|N| | Passlist []string `json:"passlist" validate:"min=1,unique,dive,fqdn"`|
|`license.kind`|string|N| `secret` ||
|`license.name`|string|Y| ||
|`sshGatewayHostKey.kind`|string|N| `secret` ||
|`sshGatewayHostKey.name`|string|Y| ||
|`disableDefinitelyGp`|bool|N| ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ envvars:
DOMAIN: test.gitpod.io
DISTRIBUTION: distribution-name
HTTP_PROXY_NAME: http-proxy-settings
LICENSE_NAME: gitpod-license
LOCAL_REGISTRY_ADDRESS: mylocalregistry.com
IMAGE_PULL_SECRET_NAME: image-pull-secret
OPEN_VSX_URL: https://my-openvsx.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ domain: test.gitpod.io
httpProxy:
kind: secret
name: http-proxy-settings
license:
kind: secret
name: gitpod-license
openVSX:
url: https://my-openvsx.com
sshGatewayHostKey:
Expand Down
1 change: 0 additions & 1 deletion install/kots/manifests/gitpod-kots-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ data:

# Secret names
HTTP_PROXY_NAME: '{{repl if (ConfigOptionEquals "enable_proxy_settings" "1" ) }}http-proxy-settings{{repl end }}'
LICENSE_NAME: gitpod-license
SSH_GATEWAY_HOST_KEY_NAME: ssh-gateway-host-key

# Database settings
Expand Down
14 changes: 0 additions & 14 deletions install/kots/manifests/gitpod-license.yaml

This file was deleted.