Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
n4bb12 committed Mar 4, 2023
1 parent 035df4f commit 3ece1e7
Show file tree
Hide file tree
Showing 5 changed files with 1,444 additions and 1,141 deletions.
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,46 +48,47 @@
"watch": "nodemon --watch src --watch verdaccio.yaml --ext ts,css,yaml --exec \"yarn dev\""
},
"dependencies": {
"@octokit/oauth-methods": "^2.0.4",
"@octokit/oauth-methods": "^2.0.5",
"@octokit/request": "^6.2.3",
"@verdaccio/url": "^11.0.0-6-next.29",
"chalk": "^4.1.2",
"dotenv": "^16.0.3",
"express": "^4.18.2",
"global-agent": "^3.0.0",
"lodash": "^4.17.21",
"memory-cache": "^0.2.0",
"minimist": "^1.2.7",
"octokit": "^2.0.13",
"open": "^8.4.0",
"minimist": "^1.2.8",
"octokit": "^2.0.14",
"open": "^8.4.2",
"ow": "^0.28.2",
"query-string": "^7.1.3"
},
"devDependencies": {
"@parcel/config-default": "~2.4.1",
"@parcel/transformer-typescript-tsc": "~2.4.1",
"@types/express": "^4.17.15",
"@types/express": "^4.17.17",
"@types/global-agent": "^2.1.1",
"@types/lodash": "^4.14.191",
"@types/memory-cache": "^0.2.2",
"@types/minimist": "^1.2.2",
"@types/node": "^16.18.11",
"@types/node": "^16.18.14",
"@types/query-string": "^6.3.0",
"@verdaccio/types": "^10.7.0",
"browserslist": "^4.21.4",
"c8": "^7.12.0",
"core-js": "^3.27.2",
"nodemon": "^2.0.20",
"browserslist": "^4.21.5",
"c8": "^7.13.0",
"core-js": "^3.29.0",
"nodemon": "^2.0.21",
"parcel": "~2.4.1",
"prettier": "^2.8.3",
"prettier": "^2.8.4",
"process": "^0.11.10",
"release-it": "^15.6.0",
"release-it": "^15.7.0",
"timekeeper": "^2.2.0",
"type-fest": "^2.19.0",
"typescript": "^4.9.4",
"verdaccio": "^5.19.1",
"verdaccio-htpasswd": "^10.5.1",
"vite": "^3.2.5",
"vitest": "^0.22.1"
"type-fest": "^3.6.1",
"typescript": "^4.9.5",
"verdaccio": "^5.21.2",
"verdaccio-htpasswd": "^10.5.2",
"vite": "^4.1.4",
"vitest": "^0.29.2"
},
"peerDependencies": {
"verdaccio": ">=5"
Expand Down
4 changes: 2 additions & 2 deletions src/server/plugin/Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Config, PackageAccess, ParsedPluginConfig } from "./Config"
import { PatchHtml } from "./PatchHtml"
import { registerGlobalProxyAgent } from "./ProxyAgent"
import { ServeStatic } from "./ServeStatic"
import { Auth, Verdaccio } from "./Verdaccio"
import { Verdaccio } from "./Verdaccio"

/**
* Implements the verdaccio plugin interfaces.
Expand All @@ -35,7 +35,7 @@ export class Plugin implements IPluginMiddleware<any>, IPluginAuth<any> {
/**
* IPluginMiddleware
*/
register_middlewares(app: Application, auth: Auth) {
register_middlewares(app: Application, auth: any) {
this.verdaccio.setAuth(auth)

const children = [
Expand Down
18 changes: 4 additions & 14 deletions src/server/plugin/Verdaccio.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import {
Config,
IBasicAuth,
JWTSignOptions,
RemoteUser,
} from "@verdaccio/types"
import { NextFunction } from "express"
import { JWTSignOptions, RemoteUser } from "@verdaccio/types"
import merge from "lodash/merge"
import { getVersion, VerdaccioConfig } from "../plugin/Config"
import { VerdaccioConfig } from "../plugin/Config"

export interface Auth extends IBasicAuth<Config> {
config: Config
apiJWTmiddleware(): NextFunction
jwtEncrypt(user: RemoteUser, signOptions: JWTSignOptions): Promise<string>
webUIJWTmiddleware(): NextFunction
}
import type Auth from "verdaccio/build/lib/auth"

export type User = RemoteUser
export { Auth }

// Most of this is duplicated Verdaccio code because it is unfortunately not availabel via API.
// https://github.com/verdaccio/verdaccio/blob/master/src/lib/auth-utils.ts#L129
Expand Down
5 changes: 4 additions & 1 deletion test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,20 @@ export function createTestPackage(
}
}

// @ts-ignore ignore private method override error.
class PatchedAuth extends Auth {
constructor(config: any) {
super(config)
}

// Avoid actually trying to load plugins.
_loadPlugin() {
return []
}
}

export function createRealVerdaccioAuth(config: Partial<Config> = {}): Auth {
return new PatchedAuth({ secret: "test-secret", ...config })
return new PatchedAuth({ secret: "test-secret", ...config }) as any
}

export function freezeTimeDuringTests(date: Date = new Date(0)) {
Expand Down
Loading

0 comments on commit 3ece1e7

Please sign in to comment.