Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Release 8.0.0 Rename gifitbitUserId to userId on the badge but le…
Browse files Browse the repository at this point in the history
…ave the field as `gui` on the JWT payload. Remove `cardId`, `templateId`, `contactUserSuppliedId` and `shopperId` from the badge. Add `valueId` to the badge.
  • Loading branch information
jeff committed Jul 25, 2018
1 parent bc8fb50 commit c85c783
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 343 deletions.
22 changes: 15 additions & 7 deletions dist/jwtauth/AuthorizationBadge.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ import { RolesConfig } from "../secureConfig";
*/
export declare class AuthorizationBadge {
private readonly rolesConfig?;
giftbitUserId: string;
userId: string;
teamMemberId: string;
merchantId: string;
cardId: string;
templateId: string;
valueId: string;
programId: string;
contactUserSuppliedId: string;
shopperId: string;
contactId: string;
serviceId: string;
metadata: {
Expand All @@ -34,10 +31,21 @@ export declare class AuthorizationBadge {
assumeJwtIdentity(jwtPayload: JwtPayload): AuthorizationBadge;
/**
* Require that the given IDs are set on the badge.
* eg: requireIds("giftbitUserId", "merchantId");
* eg: requireIds("userId", "merchantId");
*/
requireIds(...ids: ("userId" | "teamMemberId" | "merchantId" | "valueId" | "programId" | "contactId" | "serviceId")[]): void;
/**
* @deprecated use hasScope, because the name is clearer
*/
requireIds(...ids: ("giftbitUserId" | "teamMemberId" | "merchantId" | "cardId" | "templateId" | "programId" | "contactUserSuppliedId" | "shopperId" | "contactId" | "serviceId")[]): void;
isBadgeAuthorized(scope: string): boolean;
/**
* Returns true if this badge contains the given scope or any parent of the scope.
*/
hasScope(scope: string): boolean;
/**
* Returns true if the badge has all the given scopes.
*/
hasScopes(...scopes: string[]): boolean;
/**
* Require that the given scopes are authorized on the badge.
* Throws a RestError if they are not.
Expand Down
61 changes: 33 additions & 28 deletions dist/jwtauth/AuthorizationBadge.js

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

Loading

0 comments on commit c85c783

Please sign in to comment.