Skip to content

Commit

Permalink
Add a crew claim for Skeleton Crew support of users (#39)
Browse files Browse the repository at this point in the history
* Upgrade package-lock.json npm version

* Remove obsolete child_process packages from node_modules

* Upgrade package-lock.json npm version in all packages

* Fix #12 - Add a crew only claim

Create an accounts page to show it off

* Reject non-crew requests to /crew/accounts

* Remove unused enlist crew member page

* Update .yalc and package-lock.json dependencies

* Use ternary operator to ensure boolean type for crew claim

Co-authored-by: The Skeleton Crew <[email protected]>
  • Loading branch information
erran and skeletoncrewrip authored Jan 4, 2022
1 parent 1532a99 commit 1fc1e10
Show file tree
Hide file tree
Showing 78 changed files with 26,842 additions and 333 deletions.
9 changes: 0 additions & 9 deletions node_modules/child_process/README.md

This file was deleted.

46 changes: 0 additions & 46 deletions node_modules/child_process/package.json

This file was deleted.

16 changes: 15 additions & 1 deletion package-lock.json

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

1 change: 1 addition & 0 deletions packages/treat-toolbox-common/lib/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface Account {
id: string;
publicKey: string;
nonce: string;
crew: boolean | null;
}
export interface CandyMachineItem {
name: string;
Expand Down
25 changes: 24 additions & 1 deletion packages/treat-toolbox-common/package-lock.json

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

1 change: 1 addition & 0 deletions packages/treat-toolbox-common/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface Account {
id: string;
publicKey: string;
nonce: string;
crew: boolean | null;
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface Account {
id: string;
publicKey: string;
nonce: string;
crew: boolean | null;
}
export interface CandyMachineItem {
name: string;
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"private": true,
"license": "UNLICENSE",
"author": "The Skeleton Crew",
"yalcSig": "4211813e633c5002eae59f62a75ea315"
"yalcSig": "ec09dfba31ab064b91832f8806d4cc5c"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface Account {
id: string;
publicKey: string;
nonce: string;
crew: boolean | null;
}

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4211813e633c5002eae59f62a75ea315
ec09dfba31ab064b91832f8806d4cc5c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface Account {
id: string;
publicKey: string;
nonce: string;
crew: boolean | null;
}
export interface CandyMachineItem {
name: string;
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"private": true,
"license": "UNLICENSE",
"author": "The Skeleton Crew",
"yalcSig": "4211813e633c5002eae59f62a75ea315"
"yalcSig": "ec09dfba31ab064b91832f8806d4cc5c"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface Account {
id: string;
publicKey: string;
nonce: string;
crew: boolean | null;
}

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4211813e633c5002eae59f62a75ea315
ec09dfba31ab064b91832f8806d4cc5c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Account } from "@treat-toolbox/common";
export declare namespace Accounts {
function all(): Promise<Account[]>;
function create(publicKey: string, nonce: string, authId: string): Promise<void>;
function withPublicKey(publicKey: string): Promise<Account | null>;
function update(updates: {
Expand Down

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"@treat-toolbox/common": "file:.yalc/@treat-toolbox/common",
"firebase-admin": "^10.0.1"
},
"yalcSig": "abcada5add3925e881e31ca36e6d09d8"
"yalcSig": "3dedbb39237469a2457a4745bc60c3e7"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { db } from "./firebase";
import { Account } from "@treat-toolbox/common";

export namespace Accounts {
export async function all(): Promise<Account[]> {
const query = await db.collection("/accounts").get();
return query.docs.map((doc) => {
let item = doc.data() as Account;
item.id = doc.id;
return item;
});
}

export async function create(
publicKey: string,
nonce: string,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
abcada5add3925e881e31ca36e6d09d8
3dedbb39237469a2457a4745bc60c3e7
Loading

0 comments on commit 1fc1e10

Please sign in to comment.