verdaccio-passport-google-oauth-ui
Version:
<h1 align="center"> 📦🔐 Verdaccio Google OAuth </h1>
519 lines (460 loc) • 24 kB
JavaScript
var $8QOEZ$dotenv = require("dotenv");
var $8QOEZ$express = require("express");
var $8QOEZ$passportgoogleoauth = require("passport-google-oauth");
var $8QOEZ$passport = require("passport");
var $8QOEZ$picocolors = require("picocolors");
var $8QOEZ$verdacciourl = require("@verdaccio/url");
var $8QOEZ$lodash = require("lodash");
var $8QOEZ$lodashget = require("lodash/get");
var $8QOEZ$ow = require("ow");
var $8QOEZ$process = require("process");
var $8QOEZ$verdacciopackagejson = require("verdaccio/package.json");
var $8QOEZ$globalagent = require("global-agent");
var $8QOEZ$lodashmerge = require("lodash/merge");
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
function $parcel$defineInteropFlag(a) {
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
$parcel$defineInteropFlag(module.exports);
$parcel$export(module.exports, "default", () => $2319a5aa47bcd1dd$export$2e2bcd8739ae039);
var $6504657836dce84c$exports = {};
$6504657836dce84c$exports = JSON.parse("{\"$schema\":\"http://json.schemastore.org/package\",\"name\":\"verdaccio-passport-google-oauth-ui\",\"version\":\"0.1.5\",\"keywords\":[\"authentication\",\"google\",\"login\",\"npm\",\"oauth\",\"package\",\"passport\",\"private\",\"registry\",\"verdaccio\",\"verdaccio-auth\",\"verdaccio-auth-plugin\",\"verdaccio-plugin\"],\"bugs\":\"https://github.com/okayasu/verdaccio-passport-google-oauth-ui/issues\",\"repository\":\"github:okayasu/verdaccio-passport-google-oauth-ui\",\"license\":\"MIT\",\"author\":\"Masanori Okayasu\",\"main\":\"dist/server/index.js\",\"bin\":\"dist/cli/index.js\",\"files\":[\"dist\",\"verdaccio.yaml\"],\"scripts\":{\"build\":\"bash run build\",\"clean\":\"bash run clean\",\"cli\":\"bash run cli\",\"cli:login\":\"bash run cli-login\",\"cli:publish\":\"bash run cli-publish\",\"cli:whoami\":\"bash run cli-whoami\",\"copy\":\"bash run copy\",\"coverage\":\"vitest --coverage\",\"dev\":\"yarn update && yarn start\",\"docker\":\"bash run docker_\",\"fix\":\"yarn format && yarn typecheck\",\"format\":\"prettier --write \\\"**/*.{ts,js,css,scss,html,json}\\\"\",\"format:check\":\"prettier --check \\\"**/*.{ts,js,css,scss,html,json}\\\"\",\"prepack\":\"bash run clean && bash run build\",\"start\":\"verdaccio -c verdaccio.yaml\",\"test\":\"vitest\",\"typecheck\":\"bash run typecheck\",\"update\":\"yarn prepack && yarn copy\",\"watch\":\"nodemon --watch src --watch verdaccio.yaml --ext ts,css,yaml --exec \\\"yarn dev\\\"\"},\"dependencies\":{\"@octokit/oauth-methods\":\"^4.1.0\",\"@octokit/request\":\"^8.4.0\",\"@verdaccio/url\":\"^11.0.0-6-next.42\",\"dotenv\":\"^16.4.5\",\"express\":\"^4.19.2\",\"global-agent\":\"^3.0.0\",\"lodash\":\"^4.17.21\",\"memory-cache\":\"^0.2.0\",\"minimist\":\"^1.2.8\",\"octokit\":\"^3.2.1\",\"open\":\"^8.4.2\",\"ow\":\"^0.28.2\",\"passport\":\"^0.5.3\",\"passport-google-oauth\":\"^2.0.0\",\"picocolors\":\"^1.0.1\",\"query-string\":\"^7.1.3\"},\"devDependencies\":{\"@parcel/config-default\":\"~2.4.1\",\"@parcel/transformer-typescript-tsc\":\"~2.4.1\",\"@types/express\":\"^4.17.21\",\"@types/global-agent\":\"^2.1.3\",\"@types/lodash\":\"^4.17.4\",\"@types/memory-cache\":\"^0.2.5\",\"@types/minimist\":\"^1.2.5\",\"@types/node\":\"^20.12.12\",\"@types/passport\":\"^1.0.17\",\"@types/passport-google-oauth\":\"^1.0.45\",\"@types/query-string\":\"^6.3.0\",\"@verdaccio/types\":\"^10.8.0\",\"@vitest/coverage-v8\":\"^1.6.0\",\"browserslist\":\"^4.23.0\",\"core-js\":\"^3.37.1\",\"nodemon\":\"^3.1.0\",\"parcel\":\"~2.4.1\",\"prettier\":\"^3.2.5\",\"process\":\"^0.11.10\",\"release-it\":\"^16.3.0\",\"timekeeper\":\"^2.3.1\",\"type-fest\":\"^4.18.2\",\"typescript\":\"^5.4.5\",\"verdaccio\":\"^5.30.3\",\"verdaccio-htpasswd\":\"^10.5.5\",\"vitest\":\"^1.6.0\"},\"peerDependencies\":{\"verdaccio\":\">=5\"},\"packageManager\":\"yarn@3.2.1\",\"publishConfig\":{\"registry\":\"https://registry.npmjs.org/\"},\"targets\":{\"client\":{\"source\":\"src/client/verdaccio-5.ts\",\"distDir\":\"dist/client\",\"context\":\"browser\",\"includeNodeModules\":true},\"server\":{\"source\":\"src/server/index.ts\",\"distDir\":\"dist/server\",\"context\":\"node\",\"outputFormat\":\"commonjs\",\"optimize\":false,\"isLibrary\":true},\"cli\":{\"source\":\"src/cli/index.ts\",\"distDir\":\"dist/cli\",\"context\":\"node\",\"outputFormat\":\"commonjs\",\"optimize\":false}}}");
const $66fe545a7a99de1a$export$3a689f099db7e338 = (/*@__PURE__*/$parcel$interopDefault($6504657836dce84c$exports)).name;
const $66fe545a7a99de1a$export$18d4026d1ea86bb1 = (/*@__PURE__*/$parcel$interopDefault($6504657836dce84c$exports)).name.replace("verdaccio-", "");
const $66fe545a7a99de1a$export$42fcb85fa5803dac = "/-/oauth/authorize";
const $66fe545a7a99de1a$export$9e960429933a7149 = "/-/oauth/callback";
const $66fe545a7a99de1a$export$cf98473208e53590 = $66fe545a7a99de1a$export$42fcb85fa5803dac;
const $66fe545a7a99de1a$export$bd46c9d2d39fc9 = "/";
const $66fe545a7a99de1a$export$3c6c1020e175037c = 8239;
const $66fe545a7a99de1a$export$32fbdff0ec95e1c6 = "cli";
const $66fe545a7a99de1a$export$b3d17af05dbcae2f = "/oauth/authorize";
const $66fe545a7a99de1a$export$827c2d0b213c39b9 = [
"$all",
"@all",
"$authenticated",
"@authenticated",
];
const $a3e7dd257bb10667$var$prefix = ($parcel$interopDefault($8QOEZ$picocolors)).blue(`[${$66fe545a7a99de1a$export$18d4026d1ea86bb1}]`);
const $a3e7dd257bb10667$export$af88d00dbe7f521 = {
log: console.log.bind(console, $a3e7dd257bb10667$var$prefix),
error: (...args)=>console.error($a3e7dd257bb10667$var$prefix, ($parcel$interopDefault($8QOEZ$picocolors)).red(args.join(" ")))
};
$a3e7dd257bb10667$export$af88d00dbe7f521.log(`Version: ${(/*@__PURE__*/$parcel$interopDefault($6504657836dce84c$exports)).name}@${(/*@__PURE__*/$parcel$interopDefault($6504657836dce84c$exports)).version}`);
function $37f0ef9c031fa3e7$export$3d55ba16968d5eca(id) {
return $66fe545a7a99de1a$export$42fcb85fa5803dac + "/" + (id || ":id?");
}
function $37f0ef9c031fa3e7$export$d63ade3310945c4c(id) {
return $66fe545a7a99de1a$export$9e960429933a7149 + (id ? "/" + id : "");
}
const $64ab566a0c0cf8a5$var$styles = `
html,
body {
padding: 0;
margin: 0;
height: 100%;
background-color: #e0e0e0;
color: #24292F;
font-family: Helvetica, sans-serif;
position: relative;
text-align: center;
}
.wrap {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
a {
color: #3f51b5;
}
.img {
filter: drop-shadow(0 0.5rem 0.5rem #24292F80);
width: 100px;
}
`.trim().replace(/\s+/g, " ");
const $64ab566a0c0cf8a5$var$logo = `<svg class="img" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100"><defs/><defs><filter id="a" width="139.6%" height="140.4%" x="-20%" y="-12%" filterUnits="objectBoundingBox"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="2.5"/><feComposite in="shadowBlurOuter1" in2="SourceAlpha" operator="out" result="shadowBlurOuter1"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0"/></filter><filter id="c" width="167.9%" height="272.7%" x="-34%" y="-50%" filterUnits="objectBoundingBox"><feOffset dy="4" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur in="shadowOffsetOuter1" result="shadowBlurOuter1" stdDeviation="2.5"/><feColorMatrix in="shadowBlurOuter1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.0906646286 0"/></filter><path id="b" d="M48 17L33 47h-9L0 0h15l13 25 5-8h15z"/><path id="d" d="M35 11h-7V9h8l2-3h-6V4h7l1-2h-4V0h20l-6 11H35z"/></defs><g fill="none" fill-rule="evenodd"><rect width="100" height="100" fill="#000" rx="37"/><g transform="translate(22 30)"><use fill="#000" filter="url(#a)" xlink:href="#b"/><use fill="#FFF" fill-opacity=".6" xlink:href="#b"/></g><g transform="translate(22 30)"><use fill="#000" filter="url(#c)" xlink:href="#d"/><use fill="#FFF" xlink:href="#d"/></g><path fill="#FFF" d="M55 77h-9L22 30h15l21 41z"/></g></svg>`;
function $64ab566a0c0cf8a5$export$54abf82a1c28d398(body, withBackLink) {
const backButton = withBackLink ? `<p><a href="/">Go back</a></p>` : "";
return `<!DOCTYPE html>
<html lang="en">
<head>
<title>${$66fe545a7a99de1a$export$18d4026d1ea86bb1}</title>
<style>${$64ab566a0c0cf8a5$var$styles}</style>
</head>
<body>
<div class="wrap">
${$64ab566a0c0cf8a5$var$logo}
${body}
${backButton}
</div>
</body>
</html>`;
}
function $64ab566a0c0cf8a5$export$1c5ed2c43abe9c5(error, withBackLink) {
return $64ab566a0c0cf8a5$export$54abf82a1c28d398(`<h1>Sorry :(</h1>
<p>${error?.message || error}</p>`, withBackLink);
}
function $3e9d04293d727f1a$export$f654b28f82155665(config, req) {
const urlPrefix = config.url_prefix;
// Stringify headers — Verdaccio requires `string`, we have `string |
// string[] | undefined`.
const headers = $8QOEZ$lodash.mapValues(req.headers, String);
const verdaccioReq = {
...req,
headers: headers
};
const baseUrl = $8QOEZ$verdacciourl.getPublicUrl(urlPrefix, verdaccioReq);
const baseUrlWithoutTrailingSlash = baseUrl.replace(/\/$/, "");
return baseUrlWithoutTrailingSlash;
}
const $9d4f531384fce891$var$COOKIE_OPTIONS = {
sameSite: true,
httpOnly: false,
maxAge: 10000
};
class $9d4f531384fce891$export$dcc64a48664bd665 {
constructor(verdaccio, config, core){
this.verdaccio = verdaccio;
this.config = config;
this.core = core;
/**
* Initiates the auth flow by redirecting to the provider's login URL.
*/ this.authorize = async (req, res, next)=>{
try {
($parcel$interopDefault($8QOEZ$passport)).authenticate("google", {
session: false,
scope: [
"email"
]
})(req, res, next);
} catch (error) {
$a3e7dd257bb10667$export$af88d00dbe7f521.error(error);
next(error);
}
};
/**
* After successful authentication, the auth provider redirects back to us.
* We use the code in the query params to get an access token and the username
* associated with the account.
*
* We issue a JWT using these values and pass them back to the frontend as
* cookies accessible to JS so they can be stored in the browser.
*
* The username and token are encrypted and base64 encoded to form a token for
* the npm CLI.
*
* There is no need to later decode and decrypt the token. This process is
* automatically reversed by verdaccio before passing it to the plugin.
*/ this.callback = async (req, res, next)=>{
const withBackLink = true;
try {
await ($parcel$interopDefault($8QOEZ$passport)).authenticate("google", {
session: false,
failureRedirect: "/error",
failWithError: true
}, async (err, user, info)=>{
if (err) // res.status(401).send(buildAccessDeniedPage(withBackLink)):
return next(err);
if (!user) res.redirect("/");
const userObj = await this.core.createAuthenticatedUser(user.email, [
"",
]);
const uiToken = await this.verdaccio.issueUiToken(userObj);
const npmToken = await this.verdaccio.issueNpmToken(userObj, info);
res.cookie("username", userObj.name, $9d4f531384fce891$var$COOKIE_OPTIONS);
res.cookie("uiToken", uiToken, $9d4f531384fce891$var$COOKIE_OPTIONS);
res.cookie("npmToken", npmToken, $9d4f531384fce891$var$COOKIE_OPTIONS);
return res.redirect("/");
})(req, res, next);
} catch (error) {
$a3e7dd257bb10667$export$af88d00dbe7f521.error(error);
res.status(500).send($64ab566a0c0cf8a5$export$1c5ed2c43abe9c5(error, withBackLink));
}
};
}
initialize(app) {
//app.use(passport.initialize());
const conf = {
clientID: this.config.clientId,
clientSecret: this.config.clientSecret,
callbackURL: this.config.redirectUri,
passReqToCallback: true
};
($parcel$interopDefault($8QOEZ$passport)).use(new $8QOEZ$passportgoogleoauth.OAuth2Strategy(conf, (req, accessToken, refreshToken, profile, done)=>{
//console.log(accessToken);
//console.log(profile);
// GCP側で権限処理は済んでいるので、ここでは全て許可
return done(null, profile._json);
}));
}
/**
* IPluginMiddleware
*/ register_middlewares(app) {
this.initialize(app);
app.get($37f0ef9c031fa3e7$export$3d55ba16968d5eca(), this.authorize);
app.get($37f0ef9c031fa3e7$export$d63ade3310945c4c(), this.callback);
}
getRedirectUrl(req) {
const baseUrl = $3e9d04293d727f1a$export$f654b28f82155665(this.config, req);
const path = $37f0ef9c031fa3e7$export$d63ade3310945c4c(req.params.id);
const redirectUrl = baseUrl + path;
return redirectUrl;
}
}
class $03d50217570541e3$export$d28932b222e3657 {
constructor(verdaccio, config){
this.verdaccio = verdaccio;
this.config = config;
}
async createAuthenticatedUser(userName, userGroups) {
const relevantGroups = userGroups.filter((group)=>this.config.isGroupConfigured(group)
).filter(Boolean).sort();
const user = {
name: userName,
groups: [
...$66fe545a7a99de1a$export$827c2d0b213c39b9
],
real_groups: relevantGroups
};
$a3e7dd257bb10667$export$af88d00dbe7f521.log("User successfully authenticated:", user);
return user;
}
}
function $95fcf489d3c30bc0$export$c506eb22e615ba4a() {
return $8QOEZ$verdacciopackagejson.version;
}
//
// Validation
//
function $95fcf489d3c30bc0$var$validateVersion() {
const version = $95fcf489d3c30bc0$export$c506eb22e615ba4a();
if (version < "5") throw new Error("This plugin requires verdaccio 5 or above");
}
function $95fcf489d3c30bc0$var$validateNodeExists(config, node) {
const path = `[${node}][${$66fe545a7a99de1a$export$18d4026d1ea86bb1}]`;
const obj = ($parcel$interopDefault($8QOEZ$lodashget))(config, path, {});
if (!Object.keys(obj).length) throw new Error(`"${node}.${$66fe545a7a99de1a$export$18d4026d1ea86bb1}" must be enabled`);
}
function $95fcf489d3c30bc0$var$getConfigValue(config, key, predicate) {
let valueOrEnvName = ($parcel$interopDefault($8QOEZ$lodashget))(config, [
"auth",
$66fe545a7a99de1a$export$18d4026d1ea86bb1,
key
]);
const value = ($parcel$interopDefault($8QOEZ$process)).env[String(valueOrEnvName)] ?? valueOrEnvName;
try {
($parcel$interopDefault($8QOEZ$ow))(value, predicate);
} catch (error) {
$a3e7dd257bb10667$export$af88d00dbe7f521.error(`Invalid configuration at "auth.${$66fe545a7a99de1a$export$18d4026d1ea86bb1}.${key}": ${error.message} — Please check your verdaccio config.`);
($parcel$interopDefault($8QOEZ$process)).exit(1);
}
return value;
}
class $95fcf489d3c30bc0$export$9ec2d706c52a0d56 {
constructor(config){
this.config = config;
this.url_prefix = this.config.url_prefix ?? "";
this.clientId = $95fcf489d3c30bc0$var$getConfigValue(this.config, "client-id", ($parcel$interopDefault($8QOEZ$ow)).string.nonEmpty);
this.clientSecret = $95fcf489d3c30bc0$var$getConfigValue(this.config, "client-secret", ($parcel$interopDefault($8QOEZ$ow)).string.nonEmpty);
this.redirectUri = $95fcf489d3c30bc0$var$getConfigValue(this.config, "redirect-uri", ($parcel$interopDefault($8QOEZ$ow)).string.nonEmpty);
this.configuredGroupsMap = {};
this.parsedUsers = [];
this.parsedOrgs = [];
this.parsedTeams = [];
this.parsedRepos = [];
$95fcf489d3c30bc0$var$validateVersion();
$95fcf489d3c30bc0$var$validateNodeExists(config, "middlewares");
$95fcf489d3c30bc0$var$validateNodeExists(config, "auth");
this.parseConfiguredPackageGroups();
}
isGroupConfigured(group) {
return !!this.configuredGroupsMap[group];
}
/**
* Returns all permission groups used in the Verdacio config.
*/ parseConfiguredPackageGroups() {
const configuredGroups = Object.values(this.config.packages || {}).flatMap((packageConfig)=>{
return [
"access",
"publish",
"unpublish"
].flatMap((action)=>{
const allowedGroups = packageConfig[action];
if (typeof allowedGroups === "string") return allowedGroups;
if (Array.isArray(allowedGroups) && allowedGroups.every((group)=>typeof group === "string"
)) return allowedGroups;
return [];
});
});
const configuredGroupsDeduped = [
...new Set(configuredGroups)
];
configuredGroupsDeduped.forEach((group)=>{
const [providerId, key1, value1, key2, value2, key3] = group.split("/");
if (providerId !== "github") return null;
if (key1 === "user" && !key2) {
const parsedUser = {
group: group,
user: value1
};
this.parsedUsers.push(parsedUser);
this.configuredGroupsMap[group] = true;
}
if (key1 === "org" && key2 === "team" && !key3) {
const parsedTeam = {
group: group,
org: value1,
team: value2
};
this.parsedTeams.push(parsedTeam);
this.configuredGroupsMap[group] = true;
}
if ((key1 === "org" || key1 === "user") && key2 === "repo" && !key3) {
const parsedRepo = {
group: group,
owner: value1,
repo: value2
};
this.parsedRepos.push(parsedRepo);
this.configuredGroupsMap[group] = true;
}
if (key1 === "org" && !key2) {
const parsedOrg = {
group: group,
org: value1
};
this.parsedOrgs.push(parsedOrg);
this.configuredGroupsMap[group] = true;
}
});
}
}
const $44066966ce774008$export$1386576c8d11fa82 = __dirname + "/../client";
const $44066966ce774008$export$9e7acdf171605e5c = "/-/static/" + $66fe545a7a99de1a$export$18d4026d1ea86bb1;
class $d89b7d3d02568f90$export$a0f791cb3d82d3ef {
constructor(config){
this.config = config;
/**
* Patches `res.send` in order to inject style and script tags.
*/ this.patchResponse = (req, res, next)=>{
const send = res.send;
res.send = (html)=>{
html = this.insertTags(req, html);
return send.call(res, html);
};
next();
};
this.insertTags = (req, html)=>{
html = String(html);
if (!html.includes("__VERDACCIO_BASENAME_UI_OPTIONS")) return html;
const baseUrl = $3e9d04293d727f1a$export$f654b28f82155665(this.config, req);
const basePath = `${baseUrl}${$44066966ce774008$export$9e7acdf171605e5c}`;
const scriptUrl = `${basePath}/verdaccio-5.js`;
const scriptTag = `<script defer="defer" src="${scriptUrl}"></script>`;
return html.replace(/<\/body>/, [
scriptTag,
"</body>"
].join(""));
};
}
/**
* IPluginMiddleware
*/ register_middlewares(app) {
app.use(this.patchResponse);
}
}
function $ada9fb5a65d71ed3$export$532884efc244643() {
$8QOEZ$globalagent.bootstrap();
const config = JSON.stringify(GLOBAL_AGENT || {});
$a3e7dd257bb10667$export$af88d00dbe7f521.log("Proxy config:", config);
}
// 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
const $4d5eeaf277294932$var$TIME_EXPIRATION_7D = "7d";
const $4d5eeaf277294932$var$defaultSecurity = {
api: {
legacy: true
},
web: {
sign: {
expiresIn: $4d5eeaf277294932$var$TIME_EXPIRATION_7D
},
verify: {}
}
};
function $4d5eeaf277294932$var$getSecurity(config) {
return ($parcel$interopDefault($8QOEZ$lodashmerge))({}, $4d5eeaf277294932$var$defaultSecurity, config.security);
}
class $4d5eeaf277294932$export$8ba2c65662555ea6 {
constructor(config){
this.config = config;
this.security = $4d5eeaf277294932$var$getSecurity(this.config);
}
setAuth(auth) {
this.auth = auth;
return this;
}
async issueNpmToken(user, token) {
const jwtSignOptions = this.security?.api?.jwt?.sign;
if (jwtSignOptions) return this.issueVerdaccio4PlusJWT(user, jwtSignOptions);
else return this.encrypt(user.name + ":" + token);
}
async issueUiToken(user) {
const jwtSignOptions = this.security.web.sign;
return this.issueVerdaccio4PlusJWT(user, jwtSignOptions);
}
// https://github.com/verdaccio/verdaccio/blob/master/src/api/web/endpoint/user.ts#L31
async issueVerdaccio4PlusJWT(user, jwtSignOptions) {
return this.auth.jwtEncrypt(user, jwtSignOptions);
}
encrypt(text) {
return this.auth.aesEncrypt(Buffer.from(text)).toString("base64");
}
}
class $41998c6174ca267b$export$901cf72dabf2112a {
constructor(config){
this.config = config;
this.parsedConfig = new $95fcf489d3c30bc0$export$9ec2d706c52a0d56(this.config);
this.verdaccio = new $4d5eeaf277294932$export$8ba2c65662555ea6(this.config);
this.core = new $03d50217570541e3$export$d28932b222e3657(this.verdaccio, this.parsedConfig);
$ada9fb5a65d71ed3$export$532884efc244643();
}
/**
* IPluginMiddleware
*/ register_middlewares(app, auth) {
this.verdaccio.setAuth(auth);
// use static files.
app.use($44066966ce774008$export$9e7acdf171605e5c, $8QOEZ$express.static($44066966ce774008$export$1386576c8d11fa82));
const children = [
new $d89b7d3d02568f90$export$a0f791cb3d82d3ef(this.parsedConfig),
new $9d4f531384fce891$export$dcc64a48664bd665(this.verdaccio, this.parsedConfig, this.core),
];
for (const child of children)child.register_middlewares(app);
}
async userNameAndTokenMatch(userName, userToken) {
return true;
}
/**
* IPluginAuth
*/ async authenticate(userName, userToken, callback) {
callback(new Error("Signup/Login Not Implemented"), false);
}
/**
* IPluginAuth
*/ allow_access(user, config, callback) {
if (config.access) {
const grant = config.access.some((group)=>user.groups.includes(group)
);
callback(null, grant);
} else callback(null, true);
}
}
($parcel$interopDefault($8QOEZ$dotenv)).config();
var // plugins must be a default export
$2319a5aa47bcd1dd$export$2e2bcd8739ae039 = $41998c6174ca267b$export$901cf72dabf2112a;
//# sourceMappingURL=index.js.map