Skip to content

Commit

Permalink
feat: provide scope as parameter (#28)
Browse files Browse the repository at this point in the history
<!-- 👋 Hi, thanks for sending a PR to azdo-npm-auth! 💖.
Please fill out all fields below and make sure each item is true and [x]
checked.
Otherwise we may not be able to review your PR. -->

## PR Checklist

- [x] Addresses an existing open issue: fixes #27
- [x] That issue was marked as [`status: accepting
prs`](https://github.com/johnnyreilly/azdo-npm-auth/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22)
- [x] Steps in
[CONTRIBUTING.md](https://github.com/johnnyreilly/azdo-npm-auth/blob/main/.github/CONTRIBUTING.md)
were taken

## Overview

<!-- Description of what is changed and how the code change does that.
-->
See linked issue
  • Loading branch information
johnnyreilly authored Dec 19, 2024
1 parent 75f1dac commit 822b1c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/createPat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ export async function createPat({
logger = fallbackLogger,
organisation,
daysToExpiry,
scope = "vso.packaging",
}: {
logger?: Logger;
organisation: string;
daysToExpiry?: number;
scope?: string;
}): Promise<TokenResult> {
// const credential = new InteractiveBrowserCredential({});
logger.info(`Creating Azure CLI Token`);
Expand All @@ -39,7 +41,7 @@ export async function createPat({
const url = `https://vssps.dev.azure.com/${organisation}/_apis/tokens/pats?api-version=7.1-preview.1`;
const data = {
displayName: `made by azdo-npm-auth at: ${new Date().toISOString()}`,
scope: "vso.packaging",
scope,
allOrgs: false,
...(validTo && { validTo: validTo.toISOString() }),
};
Expand Down

0 comments on commit 822b1c2

Please sign in to comment.