Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ezzatron committed Dec 12, 2024
1 parent 42771ad commit bc364e7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/token-authorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ import type { TokenRequest } from "./type/token-request.js";

export type TokenAuthorizer = {
/**
* Authorize a token request for a single consuming repo.
* Authorize a token to be consumed by an account.
*/
authorizeForAccount: (
consumer: string,
request: TokenRequest,
) => TokenAuthResult;

/**
* Authorize a token to be consumed by a repo.
*/
authorizeForRepo: (
consumer: string,
Expand All @@ -34,6 +42,10 @@ export function createTokenAuthorizer(
const [resourcePatterns, consumerPatterns] = patternsForRules(config.rules);

return {
authorizeForAccount(consumer, request) {
throw new Error("Not implemented");
},

authorizeForRepo(consumer, request) {
const want = request.permissions;

Expand Down

0 comments on commit bc364e7

Please sign in to comment.