Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d390659
Add missing permissions
henrymercer Jan 24, 2025
9cd802e
Give only read-level `security-events` permission where possible
henrymercer Jan 24, 2025
3b34c67
Merge branch 'main' into henrymercer/add-permissions
henrymercer Jan 24, 2025
c22d1f3
Merge pull request #2720 from github/henrymercer/add-permissions
henrymercer Jan 24, 2025
da67fa0
Update changelog and version after v3.28.5
github-actions[bot] Jan 24, 2025
336c69e
Update checked-in dependencies
github-actions[bot] Jan 24, 2025
4b8aeab
Merge branch 'main' into mergeback/v3.28.5-to-main-f6091c01
henrymercer Jan 24, 2025
51bb5eb
Fix bug in getCredentials + tests
marcogario Jan 24, 2025
e7c0c9d
Merge pull request #2722 from github/mergeback/v3.28.5-to-main-f6091c01
Jan 24, 2025
ecf7232
Sanitize inputs
marcogario Jan 24, 2025
f6d19ed
Formatting
marcogario Jan 24, 2025
2bab9f7
Ensure artifacts are only uploaded in safe situations
aeisenberg Jan 25, 2025
5ff2464
Update changelog
aeisenberg Jan 25, 2025
f71067b
Stop using feature-flag support for determining if a feature is active
aeisenberg Jan 26, 2025
346d067
Fix CLI versions
aeisenberg Jan 27, 2025
a2c1b36
Iterate over each version
aeisenberg Jan 27, 2025
7c2eafa
Use ConfigureationError for exceptions
marcogario Jan 27, 2025
7fdbca3
build(deps-dev): bump the npm group with 4 updates
dependabot[bot] Jan 27, 2025
357e0ce
Update checked-in dependencies
github-actions[bot] Jan 27, 2025
297e89a
Merge pull request #2723 from github/marcogario/start-proxy_tests
aeisenberg Jan 27, 2025
c6b2861
Merge pull request #2731 from github/dependabot/npm_and_yarn/npm-e1e9…
aeisenberg Jan 27, 2025
62c322f
Add better comments around artifact upload tests
aeisenberg Jan 27, 2025
a879704
Clarify test fail;ure message
aeisenberg Jan 27, 2025
b494190
Merge pull request #2726 from github/aeisenberg/reenable-artifact-upload
aeisenberg Jan 27, 2025
64ad47c
Update changelog for v3.28.6
github-actions[bot] Jan 27, 2025
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
Prev Previous commit
Next Next commit
Use ConfigureationError for exceptions
  • Loading branch information
marcogario committed Jan 27, 2025
commit 7c2eafa990f431ab2f3a75ee915487b09c5ecb6e
7 changes: 4 additions & 3 deletions lib/start-proxy.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/start-proxy.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/start-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { parseLanguage, Language } from "./languages";
import { Logger } from "./logging";
import { ConfigurationError } from "./util";

export type Credential = {
type: string;
Expand Down Expand Up @@ -57,14 +58,16 @@ export function getCredentials(
} catch {
// Don't log the error since it might contain sensitive information.
logger.error("Failed to parse the credentials data.");
throw new Error("Invalid credentials format.");
throw new ConfigurationError("Invalid credentials format.");
}

const out: Credential[] = [];
for (const e of parsed) {
if (e.url === undefined && e.host === undefined) {
// The proxy needs one of these to work. If both are defined, the url has the precedence.
throw new Error("Invalid credentials - must specify host or url");
throw new ConfigurationError(
"Invalid credentials - must specify host or url",
);
}

// Filter credentials based on language if specified. `type` is the registry type.
Expand All @@ -85,7 +88,7 @@ export function getCredentials(
!isPrintable(e.password) ||
!isPrintable(e.token)
) {
throw new Error(
throw new ConfigurationError(
"Invalid credentials - fields must contain only printable characters",
);
}
Expand Down
Loading