669 lines
26 KiB
HTML
669 lines
26 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>JSDoc: Source: core/server/server.js</title>
|
|
|
|
<script src="scripts/prettify/prettify.js"> </script>
|
|
<script src="scripts/prettify/lang-css.js"> </script>
|
|
<!--[if lt IE 9]>
|
|
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
<![endif]-->
|
|
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="main">
|
|
|
|
<h1 class="page-title">Source: core/server/server.js</h1>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
<article>
|
|
<pre class="prettyprint source linenums"><code>/**
|
|
* @module
|
|
*/
|
|
|
|
import path from 'path'
|
|
import url, { fileURLToPath } from 'url'
|
|
import { bootstrap } from 'global-agent'
|
|
import cloudflareMiddleware from 'cloudflare-middleware'
|
|
import Camp from '@shields_io/camp'
|
|
import originalJoi from 'joi'
|
|
import makeBadge from '../../badge-maker/lib/make-badge.js'
|
|
import GithubConstellation from '../../services/github/github-constellation.js'
|
|
import LibrariesIoConstellation from '../../services/librariesio/librariesio-constellation.js'
|
|
import { loadServiceClasses } from '../base-service/loader.js'
|
|
import { makeSend } from '../base-service/legacy-result-sender.js'
|
|
import { handleRequest } from '../base-service/legacy-request-handler.js'
|
|
import { clearResourceCache } from '../base-service/resource-cache.js'
|
|
import { rasterRedirectUrl } from '../badge-urls/make-badge-url.js'
|
|
import {
|
|
fileSize,
|
|
nonNegativeInteger,
|
|
optionalUrl,
|
|
url as requiredUrl,
|
|
} from '../../services/validators.js'
|
|
import log from './log.js'
|
|
import PrometheusMetrics from './prometheus-metrics.js'
|
|
import InfluxMetrics from './influx-metrics.js'
|
|
const { URL } = url
|
|
|
|
const Joi = originalJoi
|
|
.extend(base => ({
|
|
type: 'arrayFromString',
|
|
base: base.array(),
|
|
coerce: (value, state, options) => ({
|
|
value: typeof value === 'string' ? value.split(' ') : value,
|
|
}),
|
|
}))
|
|
.extend(base => ({
|
|
type: 'string',
|
|
base: base.string(),
|
|
messages: {
|
|
'string.origin':
|
|
'needs to be an origin string, e.g. https://host.domain with optional port and no trailing slash',
|
|
},
|
|
rules: {
|
|
origin: {
|
|
validate(value, helpers) {
|
|
let origin
|
|
try {
|
|
;({ origin } = new URL(value))
|
|
} catch (e) {}
|
|
if (origin !== undefined && origin === value) {
|
|
return value
|
|
} else {
|
|
return helpers.error('string.origin')
|
|
}
|
|
},
|
|
},
|
|
},
|
|
}))
|
|
|
|
const origins = Joi.arrayFromString().items(Joi.string().origin())
|
|
const defaultService = Joi.object({ authorizedOrigins: origins }).default({
|
|
authorizedOrigins: [],
|
|
})
|
|
|
|
const publicConfigSchema = Joi.object({
|
|
bind: {
|
|
port: Joi.alternatives().try(
|
|
Joi.number().port(),
|
|
Joi.string().pattern(/^\\\\\.\\pipe\\.+$/),
|
|
),
|
|
address: Joi.alternatives().try(
|
|
Joi.string().ip().required(),
|
|
Joi.string().hostname().required(),
|
|
),
|
|
},
|
|
metrics: {
|
|
prometheus: {
|
|
enabled: Joi.boolean().required(),
|
|
endpointEnabled: Joi.boolean().required(),
|
|
},
|
|
influx: {
|
|
enabled: Joi.boolean().required(),
|
|
url: Joi.string()
|
|
.uri()
|
|
.when('enabled', { is: true, then: Joi.required() }),
|
|
timeoutMilliseconds: Joi.number()
|
|
.integer()
|
|
.min(1)
|
|
.when('enabled', { is: true, then: Joi.required() }),
|
|
intervalSeconds: Joi.number().integer().min(1).when('enabled', {
|
|
is: true,
|
|
then: Joi.required(),
|
|
}),
|
|
instanceIdFrom: Joi.string()
|
|
.equal('hostname', 'env-var', 'random')
|
|
.when('enabled', { is: true, then: Joi.required() }),
|
|
instanceIdEnvVarName: Joi.string().when('instanceIdFrom', {
|
|
is: 'env-var',
|
|
then: Joi.required(),
|
|
}),
|
|
envLabel: Joi.string().when('enabled', {
|
|
is: true,
|
|
then: Joi.required(),
|
|
}),
|
|
hostnameAliases: Joi.object(),
|
|
},
|
|
},
|
|
ssl: {
|
|
isSecure: Joi.boolean().required(),
|
|
key: Joi.string(),
|
|
cert: Joi.string(),
|
|
},
|
|
redirectUrl: optionalUrl,
|
|
rasterUrl: optionalUrl,
|
|
cors: {
|
|
// This doesn't actually do anything
|
|
// TODO: maybe remove in future?
|
|
// https://github.com/badges/shields/pull/8311#discussion_r945337530
|
|
allowedOrigin: Joi.array().items(optionalUrl).required(),
|
|
},
|
|
services: Joi.object({
|
|
bitbucketServer: defaultService,
|
|
drone: defaultService,
|
|
github: {
|
|
baseUri: requiredUrl,
|
|
debug: {
|
|
enabled: Joi.boolean().required(),
|
|
intervalSeconds: Joi.number().integer().min(1).required(),
|
|
},
|
|
restApiVersion: Joi.date().raw().required(),
|
|
},
|
|
gitea: defaultService,
|
|
gitlab: defaultService,
|
|
jira: defaultService,
|
|
jenkins: Joi.object({
|
|
authorizedOrigins: origins,
|
|
requireStrictSsl: Joi.boolean(),
|
|
requireStrictSslToAuthenticate: Joi.boolean(),
|
|
}).default({ authorizedOrigins: [] }),
|
|
nexus: defaultService,
|
|
npm: defaultService,
|
|
obs: defaultService,
|
|
pypi: {
|
|
baseUri: requiredUrl,
|
|
},
|
|
sonar: defaultService,
|
|
teamcity: defaultService,
|
|
weblate: defaultService,
|
|
trace: Joi.boolean().required(),
|
|
}).required(),
|
|
cacheHeaders: { defaultCacheLengthSeconds: nonNegativeInteger },
|
|
handleInternalErrors: Joi.boolean().required(),
|
|
fetchLimit: fileSize,
|
|
userAgentBase: Joi.string().required(),
|
|
requestTimeoutSeconds: nonNegativeInteger,
|
|
requestTimeoutMaxAgeSeconds: nonNegativeInteger,
|
|
documentRoot: Joi.string().default(
|
|
path.resolve(
|
|
path.dirname(fileURLToPath(import.meta.url)),
|
|
'..',
|
|
'..',
|
|
'public',
|
|
),
|
|
),
|
|
requireCloudflare: Joi.boolean().required(),
|
|
}).required()
|
|
|
|
const privateConfigSchema = Joi.object({
|
|
azure_devops_token: Joi.string(),
|
|
curseforge_api_key: Joi.string(),
|
|
discord_bot_token: Joi.string(),
|
|
dockerhub_username: Joi.string(),
|
|
dockerhub_pat: Joi.string(),
|
|
drone_token: Joi.string(),
|
|
gh_client_id: Joi.string(),
|
|
gh_client_secret: Joi.string(),
|
|
gh_token: Joi.string(),
|
|
gitea_token: Joi.string(),
|
|
gitlab_token: Joi.string(),
|
|
jenkins_user: Joi.string(),
|
|
jenkins_pass: Joi.string(),
|
|
jira_user: Joi.string(),
|
|
jira_pass: Joi.string(),
|
|
bitbucket_username: Joi.string(),
|
|
bitbucket_password: Joi.string(),
|
|
bitbucket_server_username: Joi.string(),
|
|
bitbucket_server_password: Joi.string(),
|
|
librariesio_tokens: Joi.arrayFromString().items(Joi.string()),
|
|
nexus_user: Joi.string(),
|
|
nexus_pass: Joi.string(),
|
|
npm_token: Joi.string(),
|
|
obs_user: Joi.string(),
|
|
obs_pass: Joi.string(),
|
|
redis_url: Joi.string().uri({ scheme: ['redis', 'rediss'] }),
|
|
opencollective_token: Joi.string(),
|
|
pepy_key: Joi.string(),
|
|
postgres_url: Joi.string().uri({ scheme: 'postgresql' }),
|
|
reddit_client_id: Joi.string(),
|
|
reddit_client_secret: Joi.string(),
|
|
sentry_dsn: Joi.string(),
|
|
sl_insight_userUuid: Joi.string(),
|
|
sl_insight_apiToken: Joi.string(),
|
|
sonarqube_token: Joi.string(),
|
|
stackapps_api_key: Joi.string(),
|
|
teamcity_user: Joi.string(),
|
|
teamcity_pass: Joi.string(),
|
|
twitch_client_id: Joi.string(),
|
|
twitch_client_secret: Joi.string(),
|
|
influx_username: Joi.string(),
|
|
influx_password: Joi.string(),
|
|
weblate_api_key: Joi.string(),
|
|
youtube_api_key: Joi.string(),
|
|
}).required()
|
|
const privateMetricsInfluxConfigSchema = privateConfigSchema.append({
|
|
influx_username: Joi.string().required(),
|
|
influx_password: Joi.string().required(),
|
|
})
|
|
|
|
function addHandlerAtIndex(camp, index, handlerFn) {
|
|
camp.stack.splice(index, 0, handlerFn)
|
|
}
|
|
|
|
function isOnHeroku() {
|
|
return !!process.env.DYNO
|
|
}
|
|
|
|
function isOnFly() {
|
|
return !!process.env.FLY_APP_NAME
|
|
}
|
|
|
|
/**
|
|
* The Server is based on the web framework Scoutcamp. It creates
|
|
* an http server, sets up helpers for token persistence and monitoring.
|
|
* Then it loads all the services, injecting dependencies as it
|
|
* asks each one to register its route with Scoutcamp.
|
|
*/
|
|
class Server {
|
|
/**
|
|
* Badge Server Constructor
|
|
*
|
|
* @param {object} config Configuration object read from config yaml files
|
|
* by https://www.npmjs.com/package/config and validated against
|
|
* publicConfigSchema and privateConfigSchema
|
|
* @see https://github.com/badges/shields/blob/master/doc/production-hosting.md#configuration
|
|
* @see https://github.com/badges/shields/blob/master/doc/server-secrets.md
|
|
*/
|
|
constructor(config) {
|
|
const publicConfig = Joi.attempt(config.public, publicConfigSchema)
|
|
const privateConfig = this.validatePrivateConfig(
|
|
config.private,
|
|
privateConfigSchema,
|
|
)
|
|
// We want to require an username and a password for the influx metrics
|
|
// only if the influx metrics are enabled. The private config schema
|
|
// and the public config schema are two separate schemas so we have to run
|
|
// validation manually.
|
|
if (publicConfig.metrics.influx && publicConfig.metrics.influx.enabled) {
|
|
this.validatePrivateConfig(
|
|
config.private,
|
|
privateMetricsInfluxConfigSchema,
|
|
)
|
|
}
|
|
this.config = {
|
|
public: publicConfig,
|
|
private: privateConfig,
|
|
}
|
|
|
|
this.githubConstellation = new GithubConstellation({
|
|
service: publicConfig.services.github,
|
|
private: privateConfig,
|
|
})
|
|
|
|
this.librariesioConstellation = new LibrariesIoConstellation({
|
|
private: privateConfig,
|
|
})
|
|
|
|
if (publicConfig.metrics.prometheus.enabled) {
|
|
this.metricInstance = new PrometheusMetrics()
|
|
if (publicConfig.metrics.influx.enabled) {
|
|
this.influxMetrics = new InfluxMetrics(
|
|
this.metricInstance,
|
|
Object.assign({}, publicConfig.metrics.influx, {
|
|
username: privateConfig.influx_username,
|
|
password: privateConfig.influx_password,
|
|
}),
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
validatePrivateConfig(privateConfig, privateConfigSchema) {
|
|
try {
|
|
return Joi.attempt(privateConfig, privateConfigSchema)
|
|
} catch (e) {
|
|
const badPaths = e.details.map(({ path }) => path)
|
|
throw Error(
|
|
`Private configuration is invalid. Check these paths: ${badPaths.join(
|
|
',',
|
|
)}`,
|
|
)
|
|
}
|
|
}
|
|
|
|
get port() {
|
|
const {
|
|
port,
|
|
ssl: { isSecure },
|
|
} = this.config.public
|
|
return port || (isSecure ? 443 : 80)
|
|
}
|
|
|
|
get baseUrl() {
|
|
const {
|
|
bind: { address, port },
|
|
ssl: { isSecure },
|
|
} = this.config.public
|
|
|
|
return url.format({
|
|
protocol: isSecure ? 'https' : 'http',
|
|
hostname: address,
|
|
port,
|
|
pathname: '/',
|
|
})
|
|
}
|
|
|
|
// See https://www.viget.com/articles/heroku-cloudflare-the-right-way/
|
|
requireCloudflare() {
|
|
// Set `req.ip`, which is expected by `cloudflareMiddleware()`. This is set
|
|
// by Express but not Scoutcamp.
|
|
addHandlerAtIndex(this.camp, 0, function (req, res, next) {
|
|
if (isOnHeroku()) {
|
|
// On Heroku, `req.socket.remoteAddress` is the Heroku router. However,
|
|
// the router ensures that the last item in the `X-Forwarded-For` header
|
|
// is the real origin.
|
|
// https://stackoverflow.com/a/18517550/893113
|
|
req.ip = req.headers['x-forwarded-for'].split(', ').pop()
|
|
} else if (isOnFly()) {
|
|
// On Fly we can use the Fly-Client-IP header
|
|
// https://fly.io/docs/reference/runtime-environment/#request-headers
|
|
req.ip = req.headers['fly-client-ip']
|
|
? req.headers['fly-client-ip']
|
|
: req.socket.remoteAddress
|
|
} else {
|
|
req.ip = req.socket.remoteAddress
|
|
}
|
|
next()
|
|
})
|
|
addHandlerAtIndex(this.camp, 1, cloudflareMiddleware())
|
|
}
|
|
|
|
/**
|
|
* Set up Scoutcamp routes for 404/not found responses
|
|
*/
|
|
registerErrorHandlers() {
|
|
const { camp, config } = this
|
|
const {
|
|
public: { rasterUrl },
|
|
} = config
|
|
|
|
camp.route(/\.(gif|jpg)$/, (query, match, end, request) => {
|
|
const [, format] = match
|
|
makeSend(
|
|
'svg',
|
|
request.res,
|
|
end,
|
|
)(
|
|
makeBadge({
|
|
label: '410',
|
|
message: `${format} no longer available`,
|
|
color: 'lightgray',
|
|
format: 'svg',
|
|
}),
|
|
)
|
|
})
|
|
|
|
if (!rasterUrl) {
|
|
camp.route(
|
|
/^\/((?!img|assets\/)).*\.png$/,
|
|
(query, match, end, request) => {
|
|
makeSend(
|
|
'svg',
|
|
request.res,
|
|
end,
|
|
)(
|
|
makeBadge({
|
|
label: '404',
|
|
message: 'raster badges not available',
|
|
color: 'lightgray',
|
|
format: 'svg',
|
|
}),
|
|
)
|
|
},
|
|
)
|
|
}
|
|
|
|
camp.notfound(/(\.svg|\.json|)$/, (query, match, end, request) => {
|
|
const [, extension] = match
|
|
const format = (extension || '.svg').replace(/^\./, '')
|
|
|
|
makeSend(
|
|
format,
|
|
request.res,
|
|
end,
|
|
)(
|
|
makeBadge({
|
|
label: '404',
|
|
message: 'badge not found',
|
|
color: 'red',
|
|
format,
|
|
}),
|
|
)
|
|
})
|
|
}
|
|
|
|
/**
|
|
* Set up a couple of redirects:
|
|
* One for the raster badges.
|
|
* Another to redirect the base URL /
|
|
* (we use this to redirect {@link https://img.shields.io/}
|
|
* to {@link https://shields.io/} )
|
|
*/
|
|
registerRedirects() {
|
|
const { config, camp } = this
|
|
const {
|
|
public: { rasterUrl, redirectUrl },
|
|
} = config
|
|
|
|
if (rasterUrl) {
|
|
// Redirect to the raster server for raster versions of modern badges.
|
|
camp.route(
|
|
/^\/((?!img|assets\/)).*\.png$/,
|
|
(queryParams, match, end, ask) => {
|
|
ask.res.statusCode = 301
|
|
ask.res.setHeader(
|
|
'Location',
|
|
rasterRedirectUrl({ rasterUrl }, ask.req.url),
|
|
)
|
|
|
|
const cacheDuration = (30 * 24 * 3600) | 0 // 30 days.
|
|
ask.res.setHeader('Cache-Control', `max-age=${cacheDuration}`)
|
|
|
|
ask.res.end()
|
|
},
|
|
)
|
|
}
|
|
|
|
if (redirectUrl) {
|
|
camp.route(/^\/$/, (data, match, end, ask) => {
|
|
ask.res.statusCode = 302
|
|
ask.res.setHeader('Location', redirectUrl)
|
|
ask.res.end()
|
|
})
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Iterate all the service classes defined in /services,
|
|
* load each service and register a Scoutcamp route for each service.
|
|
*/
|
|
async registerServices() {
|
|
const { config, camp, metricInstance } = this
|
|
const { apiProvider: githubApiProvider } = this.githubConstellation
|
|
const { apiProvider: librariesIoApiProvider } =
|
|
this.librariesioConstellation
|
|
;(await loadServiceClasses()).forEach(serviceClass =>
|
|
serviceClass.register(
|
|
{
|
|
camp,
|
|
handleRequest,
|
|
githubApiProvider,
|
|
librariesIoApiProvider,
|
|
metricInstance,
|
|
},
|
|
{
|
|
handleInternalErrors: config.public.handleInternalErrors,
|
|
cacheHeaders: config.public.cacheHeaders,
|
|
rasterUrl: config.public.rasterUrl,
|
|
private: config.private,
|
|
public: config.public,
|
|
},
|
|
),
|
|
)
|
|
}
|
|
|
|
bootstrapAgent() {
|
|
/*
|
|
Bootstrap global agent.
|
|
This allows self-hosting users to configure a proxy with
|
|
HTTP_PROXY, HTTPS_PROXY, NO_PROXY variables
|
|
*/
|
|
if (!('GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE' in process.env)) {
|
|
process.env.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE = ''
|
|
}
|
|
|
|
const proxyPrefix = process.env.GLOBAL_AGENT_ENVIRONMENT_VARIABLE_NAMESPACE
|
|
const HTTP_PROXY = process.env[`${proxyPrefix}HTTP_PROXY`] || null
|
|
const HTTPS_PROXY = process.env[`${proxyPrefix}HTTPS_PROXY`] || null
|
|
|
|
if (HTTP_PROXY || HTTPS_PROXY) {
|
|
bootstrap()
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Start the HTTP server:
|
|
* Bootstrap Scoutcamp,
|
|
* Register handlers,
|
|
* Start listening for requests on this.baseUrl()
|
|
*/
|
|
async start() {
|
|
const {
|
|
bind: { port, address: hostname },
|
|
ssl: { isSecure: secure, cert, key },
|
|
requireCloudflare,
|
|
} = this.config.public
|
|
|
|
this.bootstrapAgent()
|
|
|
|
log.log(`Server is starting up: ${this.baseUrl}`)
|
|
|
|
const camp = (this.camp = Camp.create({
|
|
documentRoot: this.config.public.documentRoot,
|
|
port,
|
|
hostname,
|
|
secure,
|
|
staticMaxAge: 300,
|
|
cert,
|
|
key,
|
|
}))
|
|
|
|
if (requireCloudflare) {
|
|
this.requireCloudflare()
|
|
}
|
|
|
|
const { githubConstellation, metricInstance } = this
|
|
await githubConstellation.initialize(camp)
|
|
if (metricInstance) {
|
|
if (this.config.public.metrics.prometheus.endpointEnabled) {
|
|
metricInstance.registerMetricsEndpoint(camp)
|
|
}
|
|
if (this.influxMetrics) {
|
|
this.influxMetrics.startPushingMetrics()
|
|
}
|
|
}
|
|
|
|
camp.handle((req, res, next) => {
|
|
// https://github.com/badges/shields/issues/3273
|
|
res.setHeader('Access-Control-Allow-Origin', '*')
|
|
// https://github.com/badges/shields/issues/10419
|
|
res.setHeader('Cross-Origin-Resource-Policy', 'cross-origin')
|
|
|
|
next()
|
|
})
|
|
|
|
this.registerErrorHandlers()
|
|
this.registerRedirects()
|
|
await this.registerServices()
|
|
|
|
camp.timeout = this.config.public.requestTimeoutSeconds * 1000
|
|
if (this.config.public.requestTimeoutSeconds > 0) {
|
|
camp.on('timeout', socket => {
|
|
const maxAge = this.config.public.requestTimeoutMaxAgeSeconds
|
|
socket.write('HTTP/1.1 408 Request Timeout\r\n')
|
|
socket.write('Content-Type: text/html; charset=UTF-8\r\n')
|
|
socket.write('Content-Encoding: UTF-8\r\n')
|
|
socket.write(`Cache-Control: max-age=${maxAge}, s-maxage=${maxAge}\r\n`)
|
|
socket.write('Connection: close\r\n\r\n')
|
|
socket.write('Request Timeout')
|
|
socket.end()
|
|
})
|
|
}
|
|
camp.listenAsConfigured()
|
|
|
|
await new Promise(resolve => camp.on('listening', () => resolve()))
|
|
}
|
|
|
|
static resetGlobalState() {
|
|
// This state should be migrated to instance state. When possible, do not add new
|
|
// global state.
|
|
clearResourceCache()
|
|
}
|
|
|
|
reset() {
|
|
this.constructor.resetGlobalState()
|
|
}
|
|
|
|
/**
|
|
* Stop the HTTP server and clean up helpers
|
|
*/
|
|
async stop() {
|
|
if (this.camp) {
|
|
await new Promise(resolve => this.camp.close(resolve))
|
|
this.camp = undefined
|
|
}
|
|
|
|
if (this.cleanupMonitor) {
|
|
this.cleanupMonitor()
|
|
this.cleanupMonitor = undefined
|
|
}
|
|
|
|
if (this.githubConstellation) {
|
|
await this.githubConstellation.stop()
|
|
this.githubConstellation = undefined
|
|
}
|
|
|
|
if (this.metricInstance) {
|
|
if (this.influxMetrics) {
|
|
this.influxMetrics.stopPushingMetrics()
|
|
}
|
|
this.metricInstance.stop()
|
|
}
|
|
}
|
|
}
|
|
|
|
export default Server
|
|
</code></pre>
|
|
</article>
|
|
</section>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<nav>
|
|
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-badge-maker.html">badge-maker</a></li><li><a href="module-badge-maker_lib_xml.html">badge-maker/lib/xml</a></li><li><a href="module-core_base-service_base.html">core/base-service/base</a></li><li><a href="module-core_base-service_base-graphql.html">core/base-service/base-graphql</a></li><li><a href="module-core_base-service_base-json.html">core/base-service/base-json</a></li><li><a href="module-core_base-service_base-svg-scraping.html">core/base-service/base-svg-scraping</a></li><li><a href="module-core_base-service_base-toml.html">core/base-service/base-toml</a></li><li><a href="module-core_base-service_base-xml.html">core/base-service/base-xml</a></li><li><a href="module-core_base-service_base-yaml.html">core/base-service/base-yaml</a></li><li><a href="module-core_base-service_errors.html">core/base-service/errors</a></li><li><a href="module-core_base-service_graphql.html">core/base-service/graphql</a></li><li><a href="module-core_base-service_openapi.html">core/base-service/openapi</a></li><li><a href="module-core_base-service_resource-cache.html">core/base-service/resource-cache</a></li><li><a href="module-core_base-service_service-definitions.html">core/base-service/service-definitions</a></li><li><a href="module-core_server_server.html">core/server/server</a></li><li><a href="module-core_service-test-runner_create-service-tester.html">core/service-test-runner/create-service-tester</a></li><li><a href="module-core_service-test-runner_icedfrisby-shields.html">core/service-test-runner/icedfrisby-shields</a></li><li><a href="module-core_service-test-runner_runner.html">core/service-test-runner/runner</a></li><li><a href="module-core_service-test-runner_service-tester.html">core/service-test-runner/service-tester</a></li><li><a href="module-core_service-test-runner_services-for-title.html">core/service-test-runner/services-for-title</a></li><li><a href="module-core_token-pooling_token-pool.html">core/token-pooling/token-pool</a></li><li><a href="module-services_build-status.html">services/build-status</a></li><li><a href="module-services_color-formatters.html">services/color-formatters</a></li><li><a href="module-services_contributor-count.html">services/contributor-count</a></li><li><a href="module-services_date.html">services/date</a></li><li><a href="module-services_downloads.html">services/downloads</a></li><li><a href="module-services_dynamic-common.html">services/dynamic-common</a></li><li><a href="module-services_dynamic_json-path.html">services/dynamic/json-path</a></li><li><a href="module-services_endpoint-common.html">services/endpoint-common</a></li><li><a href="module-services_licenses.html">services/licenses</a></li><li><a href="module-services_package-json-helpers.html">services/package-json-helpers</a></li><li><a href="module-services_php-version.html">services/php-version</a></li><li><a href="module-services_pipenv-helpers.html">services/pipenv-helpers</a></li><li><a href="module-services_route-builder.html">services/route-builder</a></li><li><a href="module-services_size.html">services/size</a></li><li><a href="module-services_steam_steam-base.html">services/steam/steam-base</a></li><li><a href="module-services_text-formatters.html">services/text-formatters</a></li><li><a href="module-services_validators.html">services/validators</a></li><li><a href="module-services_version.html">services/version</a></li><li><a href="module-services_website-status.html">services/website-status</a></li><li><a href="module-services_winget_version.html">services/winget/version</a></li></ul><h3>Classes</h3><ul><li><a href="BaseThunderstoreService.html">BaseThunderstoreService</a></li><li><a href="module-badge-maker_lib_xml-ElementList.html">ElementList</a></li><li><a href="module-badge-maker_lib_xml-XmlElement.html">XmlElement</a></li><li><a href="module-core_base-service_base-graphql-BaseGraphqlService.html">BaseGraphqlService</a></li><li><a href="module-core_base-service_base-json-BaseJsonService.html">BaseJsonService</a></li><li><a href="module-core_base-service_base-svg-scraping-BaseSvgScrapingService.html">BaseSvgScrapingService</a></li><li><a href="module-core_base-service_base-toml-BaseTomlService.html">BaseTomlService</a></li><li><a href="module-core_base-service_base-xml-BaseXmlService.html">BaseXmlService</a></li><li><a href="module-core_base-service_base-yaml-BaseYamlService.html">BaseYamlService</a></li><li><a href="module-core_base-service_base-BaseService.html">BaseService</a></li><li><a href="module-core_base-service_errors-Deprecated.html">Deprecated</a></li><li><a href="module-core_base-service_errors-ImproperlyConfigured.html">ImproperlyConfigured</a></li><li><a href="module-core_base-service_errors-Inaccessible.html">Inaccessible</a></li><li><a href="module-core_base-service_errors-InvalidParameter.html">InvalidParameter</a></li><li><a href="module-core_base-service_errors-InvalidResponse.html">InvalidResponse</a></li><li><a href="module-core_base-service_errors-NotFound.html">NotFound</a></li><li><a href="module-core_base-service_errors-ShieldsRuntimeError.html">ShieldsRuntimeError</a></li><li><a href="module-core_server_server-Server.html">Server</a></li><li><a href="module-core_service-test-runner_runner-Runner.html">Runner</a></li><li><a href="module-core_service-test-runner_service-tester-ServiceTester.html">ServiceTester</a></li><li><a href="module-core_token-pooling_token-pool-Token.html">Token</a></li><li><a href="module-core_token-pooling_token-pool-TokenPool.html">TokenPool</a></li><li><a href="module-services_route-builder.html">services/route-builder</a></li><li><a href="module-services_steam_steam-base-BaseSteamAPI.html">BaseSteamAPI</a></li></ul><h3>Tutorials</h3><ul><li><a href="tutorial-TUTORIAL.html">TUTORIAL</a></li><li><a href="tutorial-adding-new-config-values.html">adding-new-config-values</a></li><li><a href="tutorial-authentication.html">authentication</a></li><li><a href="tutorial-badge-urls.html">badge-urls</a></li><li><a href="tutorial-code-walkthrough.html">code-walkthrough</a></li><li><a href="tutorial-deprecating-badges.html">deprecating-badges</a></li><li><a href="tutorial-input-validation.html">input-validation</a></li><li><a href="tutorial-json-format.html">json-format</a></li><li><a href="tutorial-performance-testing.html">performance-testing</a></li><li><a href="tutorial-production-hosting.html">production-hosting</a></li><li><a href="tutorial-releases.html">releases</a></li><li><a href="tutorial-self-hosting.html">self-hosting</a></li><li><a href="tutorial-server-secrets.html">server-secrets</a></li><li><a href="tutorial-service-tests.html">service-tests</a></li><li><a href="tutorial-static-badges.html">static-badges</a></li></ul><h3>Global</h3><ul><li><a href="global.html#createNumRequestCounter">createNumRequestCounter</a></li><li><a href="global.html#fakeJwtToken">fakeJwtToken</a></li><li><a href="global.html#generateFakeConfig">generateFakeConfig</a></li><li><a href="global.html#getBadgeExampleCall">getBadgeExampleCall</a></li><li><a href="global.html#getServiceClassAuthOrigin">getServiceClassAuthOrigin</a></li><li><a href="global.html#isMetricWithPattern">isMetricWithPattern</a></li><li><a href="global.html#testAuth">testAuth</a></li></ul>
|
|
</nav>
|
|
|
|
<br class="clear">
|
|
|
|
<footer>
|
|
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Wed Mar 12 2025 18:00:19 GMT+0000 (Coordinated Universal Time)
|
|
</footer>
|
|
|
|
<script> prettyPrint(); </script>
|
|
<script src="scripts/linenumber.js"> </script>
|
|
</body>
|
|
</html>
|