@devtion/actions 0.0.0-bfc9ee4 → 0.0.0-c749be4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.mjs +265 -280
- package/dist/index.node.js +265 -280
- package/dist/types/src/helpers/constants.d.ts +6 -0
- package/dist/types/src/helpers/constants.d.ts.map +1 -1
- package/dist/types/src/helpers/security.d.ts +2 -2
- package/dist/types/src/helpers/security.d.ts.map +1 -1
- package/dist/types/src/helpers/storage.d.ts +5 -2
- package/dist/types/src/helpers/storage.d.ts.map +1 -1
- package/dist/types/src/helpers/utils.d.ts +19 -19
- package/dist/types/src/helpers/utils.d.ts.map +1 -1
- package/dist/types/src/helpers/vm.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/package.json +2 -6
- package/src/helpers/constants.ts +7 -1
- package/src/helpers/functions.ts +1 -1
- package/src/helpers/security.ts +33 -52
- package/src/helpers/services.ts +3 -3
- package/src/helpers/storage.ts +15 -3
- package/src/helpers/utils.ts +262 -268
- package/src/helpers/vm.ts +11 -5
- package/src/index.ts +2 -2
- package/src/types/index.ts +11 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/helpers/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,+CAA+C,CAAA;AAElF,eAAO,MAAM,mBAAmB,6BAA6B,CAAA;AAE7D,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC,eAAO,MAAM,sBAAsB,UAAU,CAAA;AAE7C,eAAO,MAAM,sBAAsB,SAAS,CAAA;AAE5C,eAAO,MAAM,4BAA4B,aAAa,CAAA;AAEtD,eAAO,MAAM,cAAc,sBAAsB,CAAA;AAEjD,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ChC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;GA6G5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/helpers/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,sBAAsB,+CAA+C,CAAA;AAElF,eAAO,MAAM,mBAAmB,6BAA6B,CAAA;AAE7D,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,eAAe,UAAU,CAAA;AAEtC,eAAO,MAAM,sBAAsB,UAAU,CAAA;AAE7C,eAAO,MAAM,sBAAsB,SAAS,CAAA;AAE5C,eAAO,MAAM,4BAA4B,aAAa,CAAA;AAEtD,eAAO,MAAM,cAAc,sBAAsB,CAAA;AAEjD,eAAO,MAAM,yBAAyB,iBAAiB,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2ChC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;GA6G5B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6HvB,CAAA"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param minimumAmountOfFollowing <number> The minimum amount of following the user should have
|
|
5
5
|
* @param minimumAmountOfFollowers <number> The minimum amount of followers the user should have
|
|
6
6
|
* @param minimumAmountOfPublicRepos <number> The minimum amount of public repos the user should have
|
|
7
|
-
* @returns <
|
|
7
|
+
* @returns <any> Return the avatar URL of the user if the user is reputable, false otherwise
|
|
8
8
|
*/
|
|
9
|
-
export declare const githubReputation: (userLogin: string, minimumAmountOfFollowing: number, minimumAmountOfFollowers: number, minimumAmountOfPublicRepos: number) => Promise<
|
|
9
|
+
export declare const githubReputation: (userLogin: string, minimumAmountOfFollowing: number, minimumAmountOfFollowers: number, minimumAmountOfPublicRepos: number, minimumAge: number) => Promise<any>;
|
|
10
10
|
//# sourceMappingURL=security.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../../src/helpers/security.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"security.d.ts","sourceRoot":"","sources":["../../../../src/helpers/security.ts"],"names":[],"mappings":"AA6BA;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,cACd,MAAM,4BACS,MAAM,4BACN,MAAM,8BACJ,MAAM,cACtB,MAAM,KACnB,QAAQ,GAAG,CAuBb,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Functions } from "firebase/functions";
|
|
2
|
+
import { GenericBar } from "cli-progress";
|
|
2
3
|
import { ETagWithPartNumber, ChunkWithUrl, TemporaryParticipantContributionData } from "../types/index";
|
|
3
4
|
/**
|
|
4
5
|
* Return the bucket name based on ceremony prefix.
|
|
@@ -26,9 +27,10 @@ export declare const getChunksAndPreSignedUrls: (cloudFunctions: Functions, buck
|
|
|
26
27
|
* @param cloudFunctions <Functions> - the Firebase Cloud Functions service instance.
|
|
27
28
|
* @param ceremonyId <string> - the unique identifier of the ceremony.
|
|
28
29
|
* @param alreadyUploadedChunks Array<ETagWithPartNumber> - the temporary information about the already uploaded chunks.
|
|
30
|
+
* @param logger <GenericBar> - an optional logger to show progress.
|
|
29
31
|
* @returns <Promise<Array<ETagWithPartNumber>>> - the completed (uploaded) chunks information.
|
|
30
32
|
*/
|
|
31
|
-
export declare const uploadParts: (chunksWithUrls: Array<ChunkWithUrl>, contentType: string | false, cloudFunctions?: Functions, ceremonyId?: string, alreadyUploadedChunks?: Array<ETagWithPartNumber
|
|
33
|
+
export declare const uploadParts: (chunksWithUrls: Array<ChunkWithUrl>, contentType: string | false, cloudFunctions?: Functions, ceremonyId?: string, alreadyUploadedChunks?: Array<ETagWithPartNumber>, logger?: GenericBar) => Promise<Array<ETagWithPartNumber>>;
|
|
32
34
|
/**
|
|
33
35
|
* Upload a ceremony artifact to the corresponding bucket.
|
|
34
36
|
* @notice this method implements the multi-part upload using pre-signed urls, optimal for large files.
|
|
@@ -46,8 +48,9 @@ export declare const uploadParts: (chunksWithUrls: Array<ChunkWithUrl>, contentT
|
|
|
46
48
|
* @param configStreamChunkSize <number> - size of each chunk into which the artifact is going to be splitted (nb. will be converted in MB).
|
|
47
49
|
* @param [ceremonyId] <string> - the unique identifier of the ceremony (used as a double-edge sword - as identifier and as a check if current contributor is the coordinator finalizing the ceremony).
|
|
48
50
|
* @param [temporaryDataToResumeMultiPartUpload] <TemporaryParticipantContributionData> - the temporary information necessary to resume an already started multi-part upload.
|
|
51
|
+
* @param logger <GenericBar> - an optional logger to show progress.
|
|
49
52
|
*/
|
|
50
|
-
export declare const multiPartUpload: (cloudFunctions: Functions, bucketName: string, objectKey: string, localFilePath: string, configStreamChunkSize: number, ceremonyId?: string, temporaryDataToResumeMultiPartUpload?: TemporaryParticipantContributionData) => Promise<void>;
|
|
53
|
+
export declare const multiPartUpload: (cloudFunctions: Functions, bucketName: string, objectKey: string, localFilePath: string, configStreamChunkSize: number, ceremonyId?: string, temporaryDataToResumeMultiPartUpload?: TemporaryParticipantContributionData, logger?: GenericBar) => Promise<void>;
|
|
51
54
|
/**
|
|
52
55
|
* Download an artifact from S3 (only for authorized users)
|
|
53
56
|
* @param cloudFunctions <Functions> Firebase cloud functions instance.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/helpers/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAK9C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,oCAAoC,EAAE,MAAM,gBAAgB,CAAA;AAWvG;;;;;GAKG;AACH,eAAO,MAAM,aAAa,mBAAoB,MAAM,mBAAmB,MAAM,KAAG,MACvC,CAAA;AAEzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,mBAClB,SAAS,cACb,MAAM,aACP,MAAM,iBACF,MAAM,YACX,MAAM,yBACO,MAAM,eAChB,MAAM,KACpB,QAAQ,MAAM,YAAY,CAAC,CA6B7B,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/helpers/storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAK9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,oCAAoC,EAAE,MAAM,gBAAgB,CAAA;AAWvG;;;;;GAKG;AACH,eAAO,MAAM,aAAa,mBAAoB,MAAM,mBAAmB,MAAM,KAAG,MACvC,CAAA;AAEzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,mBAClB,SAAS,cACb,MAAM,aACP,MAAM,iBACF,MAAM,YACX,MAAM,yBACO,MAAM,eAChB,MAAM,KACpB,QAAQ,MAAM,YAAY,CAAC,CA6B7B,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,mBACJ,MAAM,YAAY,CAAC,eACtB,MAAM,GAAG,KAAK,mBACV,SAAS,eACb,MAAM,0BACK,MAAM,kBAAkB,CAAC,WACxC,UAAU,KACpB,QAAQ,MAAM,kBAAkB,CAAC,CAiDnC,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,mBACR,SAAS,cACb,MAAM,aACP,MAAM,iBACF,MAAM,yBACE,MAAM,eAChB,MAAM,yCACoB,oCAAoC,WAClE,UAAU,kBAqDtB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,mBACjB,SAAS,cACb,MAAM,eACL,MAAM,aACR,MAAM,kBAuBpB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,kBAAmB,MAAM,wBAAwB,MAAM,KAAG,MACN,CAAA;AAEvF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,kBAAmB,MAAM,wBAAwB,MAAM,KAAG,MACN,CAAA;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,wBAAyB,MAAM,KAAG,MACA,CAAA;AAEpE;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,kBAAmB,MAAM,wBAAwB,MAAM,KAAG,MACwC,CAAA;AAErI;;;;;;;GAOG;AACH,eAAO,MAAM,iCAAiC,kBAC3B,MAAM,mCACY,MAAM,KACxC,MAAwG,CAAA;AAE3G;;;;;;;GAOG;AACH,eAAO,MAAM,kCAAkC,kBAC5B,MAAM,oCACa,MAAM,KACzC,MAAyG,CAAA;AAE5G;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,kBAAmB,MAAM,8BAA8B,MAAM,KAAG,MACoC,CAAA"}
|
|
@@ -4,13 +4,20 @@ import { ReadPosition } from "fs";
|
|
|
4
4
|
import winston, { Logger } from "winston";
|
|
5
5
|
import { CircuitMetadata, Contribution, ContributionValidity, FirebaseDocumentInfo, SetupCeremonyData } from "../types/index";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @param cleanup <boolean> - whether to delete the r1cs file after parsing
|
|
11
|
-
* @returns any - the data to pass to the cloud function for setup and the circuit artifacts
|
|
7
|
+
* Return a string with double digits if the provided input is one digit only.
|
|
8
|
+
* @param in <number> - the input number to be converted.
|
|
9
|
+
* @returns <string> - the two digits stringified number derived from the conversion.
|
|
12
10
|
*/
|
|
13
|
-
export declare const
|
|
11
|
+
export declare const convertToDoubleDigits: (amount: number) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Extract a prefix consisting of alphanumeric and underscore characters from a string with arbitrary characters.
|
|
14
|
+
* @dev replaces all special symbols and whitespaces with an underscore char ('_'). Convert all uppercase chars to lowercase.
|
|
15
|
+
* @notice example: str = 'Multiplier-2!2.4.zkey'; output prefix = 'multiplier_2_2_4.zkey'.
|
|
16
|
+
* NB. Prefix extraction is a key process that conditions the name of the ceremony artifacts, download/upload from/to storage, collections paths.
|
|
17
|
+
* @param str <string> - the arbitrary string from which to extract the prefix.
|
|
18
|
+
* @returns <string> - the resulting prefix.
|
|
19
|
+
*/
|
|
20
|
+
export declare const extractPrefix: (str: string) => string;
|
|
14
21
|
/**
|
|
15
22
|
* Extract data from a R1CS metadata file generated with a custom file-based logger.
|
|
16
23
|
* @notice useful for extracting metadata circuits contained in the generated file using a logger
|
|
@@ -41,15 +48,6 @@ export declare const formatZkeyIndex: (progress: number) => string;
|
|
|
41
48
|
* @returns <number> - the amount of powers.
|
|
42
49
|
*/
|
|
43
50
|
export declare const extractPoTFromFilename: (potCompleteFilename: string) => number;
|
|
44
|
-
/**
|
|
45
|
-
* Extract a prefix consisting of alphanumeric and underscore characters from a string with arbitrary characters.
|
|
46
|
-
* @dev replaces all special symbols and whitespaces with an underscore char ('_'). Convert all uppercase chars to lowercase.
|
|
47
|
-
* @notice example: str = 'Multiplier-2!2.4.zkey'; output prefix = 'multiplier_2_2_4.zkey'.
|
|
48
|
-
* NB. Prefix extraction is a key process that conditions the name of the ceremony artifacts, download/upload from/to storage, collections paths.
|
|
49
|
-
* @param str <string> - the arbitrary string from which to extract the prefix.
|
|
50
|
-
* @returns <string> - the resulting prefix.
|
|
51
|
-
*/
|
|
52
|
-
export declare const extractPrefix: (str: string) => string;
|
|
53
51
|
/**
|
|
54
52
|
* Automate the generation of an entropy for a contribution.
|
|
55
53
|
* @dev Took inspiration from here https://github.com/glamperd/setup-mpc-ui/blob/master/client/src/state/Compute.tsx#L112.
|
|
@@ -131,9 +129,11 @@ export declare const readBytesFromFile: (localFilePath: string, offset: number,
|
|
|
131
129
|
*/
|
|
132
130
|
export declare const getR1CSInfo: (localR1CSFilePath: string) => CircuitMetadata;
|
|
133
131
|
/**
|
|
134
|
-
*
|
|
135
|
-
* @
|
|
136
|
-
* @
|
|
132
|
+
* Parse and validate that the ceremony configuration is correct
|
|
133
|
+
* @notice this does not upload any files to storage
|
|
134
|
+
* @param path <string> - the path to the configuration file
|
|
135
|
+
* @param cleanup <boolean> - whether to delete the r1cs file after parsing
|
|
136
|
+
* @returns any - the data to pass to the cloud function for setup and the circuit artifacts
|
|
137
137
|
*/
|
|
138
|
-
export declare const
|
|
138
|
+
export declare const parseCeremonyFile: (path: string, cleanup?: boolean) => Promise<SetupCeremonyData>;
|
|
139
139
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/helpers/utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAW,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/helpers/utils.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAW,EAAE,YAAY,EAAqB,MAAM,IAAI,CAAA;AAExD,OAAO,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAIzC,OAAO,EACH,eAAe,EACf,YAAY,EAGZ,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EAGpB,MAAM,gBAAgB,CAAA;AAiBvB;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,WAAY,MAAM,KAAG,MAA0D,CAAA;AAEjH;;;;;;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O,MAAM,iBAAiB,kBACX,MAAM,UACb,MAAM,UACN,MAAM,YACJ,YAAY,KACvB,MAYF,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,sBAAuB,MAAM,KAAG,eA0IvD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,SAAgB,MAAM,YAAW,OAAO,KAAW,QAAQ,iBAAiB,CA4NzG,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vm.d.ts","sourceRoot":"","sources":["../../../../src/helpers/vm.ts"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EAEZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEH,SAAS,EAGZ,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOtC;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAa,QAAQ,SAAS,CAYzD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAa,QAAQ,SAAS,CAYzD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,eAAgB,MAAM,KAAG,MAAM,MAAM,CAInE,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,sCAAsC,aACrC,MAAM,WACP,MAAM,YACL,MAAM,UACR,MAAM,KACf,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"vm.d.ts","sourceRoot":"","sources":["../../../../src/helpers/vm.ts"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EAEZ,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEH,SAAS,EAGZ,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOtC;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAa,QA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,MAAM,qBAAqB,QAAe,SAAS,cAAc,MAAM,aAAa,MAAM,KAAG,QAAQ,MAAM,CAgBjH,CAAA"}
|
|
@@ -9,14 +9,14 @@ import { CeremonyState, CeremonyTimeoutType, CeremonyType, CircuitContributionVe
|
|
|
9
9
|
* @property {string} accessKeyId - the key identifier related to S3 APIs.
|
|
10
10
|
* @property {string} secretAccessKey - the secret access key related to S3 APIs.
|
|
11
11
|
* @property {string} region - the region where your buckets are located.
|
|
12
|
-
* @property {string}
|
|
12
|
+
* @property {string} instanceProfileArn - the EC2 instance profile the VM should use to access S3.
|
|
13
13
|
* @property {string} amiId - the AWS AMI ID (default to Amazon Linux 2).
|
|
14
14
|
*/
|
|
15
15
|
export type AWSVariables = {
|
|
16
16
|
accessKeyId: string;
|
|
17
17
|
secretAccessKey: string;
|
|
18
18
|
region: string;
|
|
19
|
-
|
|
19
|
+
instanceProfileArn: string;
|
|
20
20
|
amiId: string;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EACH,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,wCAAwC,EACxC,aAAa,EACb,2BAA2B,EAC3B,iBAAiB,EACpB,MAAM,YAAY,CAAA;AAEnB;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names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A;CACf,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,oBAAoB,EAAE,mBAAmB,CAAA;IACzC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,KAAK,CACX,eAAe,GACX,qCAAqC,GACrC,mCAAmC,GACnC,gCAAgC,CACvC,CAAA;CACJ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devtion/actions",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-c749be4",
|
|
4
4
|
"description": "A set of actions and helpers for CLI commands",
|
|
5
5
|
"repository": "git@github.com:privacy-scaling-explorations/p0tion.git",
|
|
6
6
|
"homepage": "https://github.com/privacy-scaling-explorations/p0tion",
|
|
@@ -55,10 +55,6 @@
|
|
|
55
55
|
"firebase": "^9.21.0",
|
|
56
56
|
"firebase-admin": "^11.8.0",
|
|
57
57
|
"googleapis": "^118.0.0",
|
|
58
|
-
"puppeteer": "^20.1.2",
|
|
59
|
-
"puppeteer-extra": "^3.3.6",
|
|
60
|
-
"puppeteer-extra-plugin-anonymize-ua": "^2.4.6",
|
|
61
|
-
"puppeteer-extra-plugin-stealth": "^2.11.2",
|
|
62
58
|
"rimraf": "^5.0.0",
|
|
63
59
|
"rollup": "^3.21.6",
|
|
64
60
|
"snarkjs": "^0.6.11",
|
|
@@ -83,5 +79,5 @@
|
|
|
83
79
|
"publishConfig": {
|
|
84
80
|
"access": "public"
|
|
85
81
|
},
|
|
86
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "b58b49526070e9e95f9d13ebe0f24dd62a08a09d"
|
|
87
83
|
}
|
package/src/helpers/constants.ts
CHANGED
|
@@ -217,6 +217,12 @@ export const commonTerms = {
|
|
|
217
217
|
verificationStartedAt: "verificationStartedAt"
|
|
218
218
|
}
|
|
219
219
|
},
|
|
220
|
+
avatars: {
|
|
221
|
+
name: "avatars",
|
|
222
|
+
fields: {
|
|
223
|
+
avatarUrl: "avatarUrl"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
220
226
|
ceremonies: {
|
|
221
227
|
name: "ceremonies",
|
|
222
228
|
fields: {
|
|
@@ -307,6 +313,6 @@ export const commonTerms = {
|
|
|
307
313
|
finalizeCircuit: "finalizeCircuit",
|
|
308
314
|
finalizeCeremony: "finalizeCeremony",
|
|
309
315
|
downloadCircuitArtifacts: "downloadCircuitArtifacts",
|
|
310
|
-
transferObject: "transferObject"
|
|
316
|
+
transferObject: "transferObject"
|
|
311
317
|
}
|
|
312
318
|
}
|
package/src/helpers/functions.ts
CHANGED
package/src/helpers/security.ts
CHANGED
|
@@ -1,57 +1,30 @@
|
|
|
1
1
|
import fetch from "@adobe/node-fetch-retry"
|
|
2
2
|
/**
|
|
3
|
-
* This function
|
|
4
|
-
* @param user
|
|
5
|
-
* @returns
|
|
3
|
+
* This function queries the GitHub API to fetch users statistics
|
|
4
|
+
* @param user {string} the user uid
|
|
5
|
+
* @returns {any} the stats from the GitHub API
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
8
|
-
const response = await fetch(`https://api.github.com/user/${user}
|
|
7
|
+
const getGitHubStats = async (user: string): Promise<any> => {
|
|
8
|
+
const response = await fetch(`https://api.github.com/user/${user}`, {
|
|
9
9
|
method: "GET",
|
|
10
10
|
headers: {
|
|
11
11
|
Authorization: `token ${process.env.GITHUB_ACCESS_TOKEN!}`
|
|
12
12
|
}
|
|
13
13
|
})
|
|
14
14
|
if (response.status !== 200)
|
|
15
|
-
throw new Error("It was not possible to retrieve the
|
|
16
|
-
const jsonData: any = await response.json()
|
|
17
|
-
return jsonData.length
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* This function will return the number of followers of a user
|
|
21
|
-
* @param user <string> The username of the user
|
|
22
|
-
* @returns <number> The number of followers
|
|
23
|
-
*/
|
|
24
|
-
const getNumberOfFollowersGitHub = async (user: string): Promise<number> => {
|
|
25
|
-
const response = await fetch(`https://api.github.com/user/${user}/followers`, {
|
|
26
|
-
method: "GET",
|
|
27
|
-
headers: {
|
|
28
|
-
Authorization: `token ${process.env.GITHUB_ACCESS_TOKEN!}`
|
|
29
|
-
}
|
|
30
|
-
})
|
|
31
|
-
if (response.status !== 200)
|
|
32
|
-
throw new Error("It was not possible to retrieve the number of followers. Please try again.")
|
|
33
|
-
const jsonData: any = await response.json()
|
|
34
|
-
return jsonData.length
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* This function will return the number of following of a user
|
|
38
|
-
* @param user <string> The username of the user
|
|
39
|
-
* @returns <number> The number of following users
|
|
40
|
-
*/
|
|
41
|
-
const getNumberOfFollowingGitHub = async (user: string): Promise<number> => {
|
|
42
|
-
const response = await fetch(`https://api.github.com/user/${user}/following`, {
|
|
43
|
-
method: "GET",
|
|
44
|
-
headers: {
|
|
45
|
-
Authorization: `token ${process.env.GITHUB_ACCESS_TOKEN!}`
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
if (response.status !== 200)
|
|
50
|
-
throw new Error("It was not possible to retrieve the number of following. Please try again.")
|
|
15
|
+
throw new Error("It was not possible to retrieve the user's statistic. Please try again.")
|
|
51
16
|
|
|
52
17
|
const jsonData: any = await response.json()
|
|
53
18
|
|
|
54
|
-
|
|
19
|
+
const data = {
|
|
20
|
+
following: jsonData.following,
|
|
21
|
+
followers: jsonData.followers,
|
|
22
|
+
publicRepos: jsonData.public_repos,
|
|
23
|
+
avatarUrl: jsonData.avatar_url,
|
|
24
|
+
age: jsonData.created_at
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return data
|
|
55
28
|
}
|
|
56
29
|
|
|
57
30
|
/**
|
|
@@ -60,27 +33,35 @@ const getNumberOfFollowingGitHub = async (user: string): Promise<number> => {
|
|
|
60
33
|
* @param minimumAmountOfFollowing <number> The minimum amount of following the user should have
|
|
61
34
|
* @param minimumAmountOfFollowers <number> The minimum amount of followers the user should have
|
|
62
35
|
* @param minimumAmountOfPublicRepos <number> The minimum amount of public repos the user should have
|
|
63
|
-
* @returns <
|
|
36
|
+
* @returns <any> Return the avatar URL of the user if the user is reputable, false otherwise
|
|
64
37
|
*/
|
|
65
38
|
export const githubReputation = async (
|
|
66
39
|
userLogin: string,
|
|
67
40
|
minimumAmountOfFollowing: number,
|
|
68
41
|
minimumAmountOfFollowers: number,
|
|
69
|
-
minimumAmountOfPublicRepos: number
|
|
70
|
-
|
|
42
|
+
minimumAmountOfPublicRepos: number,
|
|
43
|
+
minimumAge: number
|
|
44
|
+
): Promise<any> => {
|
|
71
45
|
if (!process.env.GITHUB_ACCESS_TOKEN)
|
|
72
46
|
throw new Error(
|
|
73
47
|
"The GitHub access token is missing. Please insert a valid token to be used for anti-sybil checks on user registation, and then try again."
|
|
74
48
|
)
|
|
75
|
-
|
|
76
|
-
const
|
|
77
|
-
const followers = await getNumberOfFollowersGitHub(userLogin)
|
|
49
|
+
|
|
50
|
+
const { following, followers, publicRepos, avatarUrl, age } = await getGitHubStats(userLogin)
|
|
78
51
|
|
|
79
52
|
if (
|
|
80
53
|
following < minimumAmountOfFollowing ||
|
|
81
|
-
|
|
82
|
-
followers < minimumAmountOfFollowers
|
|
54
|
+
publicRepos < minimumAmountOfPublicRepos ||
|
|
55
|
+
followers < minimumAmountOfFollowers ||
|
|
56
|
+
new Date(age) > new Date(Date.now() - minimumAge)
|
|
83
57
|
)
|
|
84
|
-
return
|
|
85
|
-
|
|
58
|
+
return {
|
|
59
|
+
reputable: false,
|
|
60
|
+
avatarUrl: ""
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
reputable: true,
|
|
65
|
+
avatarUrl
|
|
66
|
+
}
|
|
86
67
|
}
|
package/src/helpers/services.ts
CHANGED
|
@@ -22,7 +22,7 @@ export const getFirestoreDatabase = (app: FirebaseApp): Firestore => getFirestor
|
|
|
22
22
|
* @param app <FirebaseApp> - the Firebase application.
|
|
23
23
|
* @returns <Functions> - the Cloud Functions associated to the application.
|
|
24
24
|
*/
|
|
25
|
-
export const getFirebaseFunctions = (app: FirebaseApp): Functions => getFunctions(app,
|
|
25
|
+
export const getFirebaseFunctions = (app: FirebaseApp): Functions => getFunctions(app, "europe-west1")
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Retrieve the configuration variables for the AWS services (S3, EC2).
|
|
@@ -33,7 +33,7 @@ export const getAWSVariables = (): AWSVariables => {
|
|
|
33
33
|
!process.env.AWS_ACCESS_KEY_ID ||
|
|
34
34
|
!process.env.AWS_SECRET_ACCESS_KEY ||
|
|
35
35
|
!process.env.AWS_REGION ||
|
|
36
|
-
!process.env.
|
|
36
|
+
!process.env.AWS_INSTANCE_PROFILE_ARN ||
|
|
37
37
|
!process.env.AWS_AMI_ID
|
|
38
38
|
)
|
|
39
39
|
throw new Error(
|
|
@@ -44,7 +44,7 @@ export const getAWSVariables = (): AWSVariables => {
|
|
|
44
44
|
accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
|
|
45
45
|
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
|
|
46
46
|
region: process.env.AWS_REGION || "us-east-1",
|
|
47
|
-
|
|
47
|
+
instanceProfileArn: process.env.AWS_INSTANCE_PROFILE_ARN!,
|
|
48
48
|
amiId: process.env.AWS_AMI_ID!
|
|
49
49
|
}
|
|
50
50
|
}
|
package/src/helpers/storage.ts
CHANGED
|
@@ -3,6 +3,7 @@ import mime from "mime-types"
|
|
|
3
3
|
import fs, { createWriteStream } from "fs"
|
|
4
4
|
import fetch from "@adobe/node-fetch-retry"
|
|
5
5
|
import https from "https"
|
|
6
|
+
import { GenericBar } from "cli-progress"
|
|
6
7
|
import { ETagWithPartNumber, ChunkWithUrl, TemporaryParticipantContributionData } from "../types/index"
|
|
7
8
|
import { commonTerms } from "./constants"
|
|
8
9
|
import {
|
|
@@ -80,6 +81,7 @@ export const getChunksAndPreSignedUrls = async (
|
|
|
80
81
|
* @param cloudFunctions <Functions> - the Firebase Cloud Functions service instance.
|
|
81
82
|
* @param ceremonyId <string> - the unique identifier of the ceremony.
|
|
82
83
|
* @param alreadyUploadedChunks Array<ETagWithPartNumber> - the temporary information about the already uploaded chunks.
|
|
84
|
+
* @param logger <GenericBar> - an optional logger to show progress.
|
|
83
85
|
* @returns <Promise<Array<ETagWithPartNumber>>> - the completed (uploaded) chunks information.
|
|
84
86
|
*/
|
|
85
87
|
export const uploadParts = async (
|
|
@@ -87,11 +89,15 @@ export const uploadParts = async (
|
|
|
87
89
|
contentType: string | false,
|
|
88
90
|
cloudFunctions?: Functions,
|
|
89
91
|
ceremonyId?: string,
|
|
90
|
-
alreadyUploadedChunks?: Array<ETagWithPartNumber
|
|
92
|
+
alreadyUploadedChunks?: Array<ETagWithPartNumber>,
|
|
93
|
+
logger?: GenericBar
|
|
91
94
|
): Promise<Array<ETagWithPartNumber>> => {
|
|
92
95
|
// Keep track of uploaded chunks.
|
|
93
96
|
const uploadedChunks: Array<ETagWithPartNumber> = alreadyUploadedChunks || []
|
|
94
97
|
|
|
98
|
+
// if we were passed a logger, start it
|
|
99
|
+
if (logger) logger.start(chunksWithUrls.length, 0)
|
|
100
|
+
|
|
95
101
|
// Loop through remaining chunks.
|
|
96
102
|
for (let i = alreadyUploadedChunks ? alreadyUploadedChunks.length : 0; i < chunksWithUrls.length; i += 1) {
|
|
97
103
|
// Consume the pre-signed url to upload the chunk.
|
|
@@ -128,6 +134,9 @@ export const uploadParts = async (
|
|
|
128
134
|
// nb. this must be done only when contributing (not finalizing).
|
|
129
135
|
if (!!ceremonyId && !!cloudFunctions)
|
|
130
136
|
await temporaryStoreCurrentContributionUploadedChunkData(cloudFunctions, ceremonyId, chunk)
|
|
137
|
+
|
|
138
|
+
// increment the count on the logger
|
|
139
|
+
if (logger) logger.increment()
|
|
131
140
|
}
|
|
132
141
|
|
|
133
142
|
return uploadedChunks
|
|
@@ -150,6 +159,7 @@ export const uploadParts = async (
|
|
|
150
159
|
* @param configStreamChunkSize <number> - size of each chunk into which the artifact is going to be splitted (nb. will be converted in MB).
|
|
151
160
|
* @param [ceremonyId] <string> - the unique identifier of the ceremony (used as a double-edge sword - as identifier and as a check if current contributor is the coordinator finalizing the ceremony).
|
|
152
161
|
* @param [temporaryDataToResumeMultiPartUpload] <TemporaryParticipantContributionData> - the temporary information necessary to resume an already started multi-part upload.
|
|
162
|
+
* @param logger <GenericBar> - an optional logger to show progress.
|
|
153
163
|
*/
|
|
154
164
|
export const multiPartUpload = async (
|
|
155
165
|
cloudFunctions: Functions,
|
|
@@ -158,7 +168,8 @@ export const multiPartUpload = async (
|
|
|
158
168
|
localFilePath: string,
|
|
159
169
|
configStreamChunkSize: number,
|
|
160
170
|
ceremonyId?: string,
|
|
161
|
-
temporaryDataToResumeMultiPartUpload?: TemporaryParticipantContributionData
|
|
171
|
+
temporaryDataToResumeMultiPartUpload?: TemporaryParticipantContributionData,
|
|
172
|
+
logger?: GenericBar
|
|
162
173
|
) => {
|
|
163
174
|
// The unique identifier of the multi-part upload.
|
|
164
175
|
let multiPartUploadId: string = ""
|
|
@@ -198,7 +209,8 @@ export const multiPartUpload = async (
|
|
|
198
209
|
mime.lookup(localFilePath), // content-type.
|
|
199
210
|
cloudFunctions,
|
|
200
211
|
ceremonyId,
|
|
201
|
-
alreadyUploadedChunks
|
|
212
|
+
alreadyUploadedChunks,
|
|
213
|
+
logger
|
|
202
214
|
)
|
|
203
215
|
|
|
204
216
|
// Step (3).
|