Skip to content

WIP [explicit video refs] new server #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0eab795
media reference object types
osdiab Oct 30, 2018
4233ebd
add legacy operation types
osdiab Oct 30, 2018
1d7a92d
add legacy types for api responses
osdiab Oct 30, 2018
f5ca808
allow endpoints that involve video tokens to either be current or leg…
osdiab Oct 30, 2018
ae86265
fix incorrect types in shared models
osdiab Nov 2, 2018
9be742a
make client routes only pass in content of video reference
osdiab Nov 2, 2018
782072f
just store operations as merged legacy and current version for impl s…
osdiab Nov 2, 2018
b2813d1
operationsFlaggingThisMember optional, email_address_verified boolean…
osdiab Nov 5, 2018
0b71cab
add crypto-random-string dep
osdiab Nov 2, 2018
fa1d262
add random ID generation
osdiab Nov 2, 2018
362345e
move video moving functions from createMember to helper file
osdiab Nov 2, 2018
690a83a
add legacy invite video helper for copying new invite videos to publi…
osdiab Nov 2, 2018
e1cbdb5
add getPublicUrl helpers in legacy
osdiab Nov 2, 2018
92e7346
use getPublicUrl helper in verify
osdiab Nov 2, 2018
28dcf2b
more explicit return types in legacy helpers
osdiab Nov 2, 2018
f5fc883
store videos at new generated id, object args/returns
osdiab Nov 2, 2018
fc631b5
sendInvite now uses videoReference
osdiab Nov 2, 2018
029ca1d
pass sendInvite params as an object
osdiab Nov 5, 2018
5b4c81e
minor comments changes
osdiab Nov 5, 2018
c293e3a
move create video reference legacy helper to legacy helpers file
osdiab Nov 5, 2018
ac2d62f
add comments for legacy video helpers
osdiab Nov 5, 2018
f7a7925
Reorg legacy video methods
osdiab Nov 5, 2018
84f3780
rename legacy video methods again and better comment what's going on …
osdiab Nov 5, 2018
a01d558
memberUid -> memberId
osdiab Nov 5, 2018
0c13ace
Rename publicinvitevideoref to publicidentityvideoref
osdiab Nov 5, 2018
2661ebe
simplify video helpers identity ref fn
osdiab Nov 5, 2018
c2ec111
named args for createInvitedMember/createUninvtedMember, req email ad…
osdiab Nov 5, 2018
213c35d
rename legacy_ to legacy_compat_ methods for sendInvite
osdiab Nov 5, 2018
d70e814
rewordings of legacy fns
osdiab Nov 5, 2018
32dc6a0
make legacy identity video creation method robust to any video stored…
osdiab Nov 5, 2018
53a5dcd
place videos properly for legacy compatibility in createMember
osdiab Nov 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@types/big.js": "^4.0.4",
"@types/url-join": "^0.8.2",
"big.js": "^5.0.3",
"crypto-random-string": "^1.0.0",
Copy link
Member

@markulrich markulrich Nov 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package appears to be all of one line, can we just use said line https://github.com/sindresorhus/crypto-random-string/blob/master/index.js#L9 and avoid yet another external dep?

"discourse-sso": "rahafoundation/discourse_sso_node",
"firebase-admin": "^5.12.0",
"http-status": "^1.2.0",
Expand All @@ -39,6 +40,7 @@
"deploy-test": "yarn use-test-config && yarn build && gcloud app deploy --project=raha-test"
},
"devDependencies": {
"@types/crypto-random-string": "^1.0.0",
"@types/jest": "^23.3.0",
"@types/koa": "^2.0.45",
"@types/koa-bodyparser": "^4.2.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/server/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,13 @@ const apiRoutes: Array<RouteHandler<ApiLocation>> = [
},
{
location: sendInviteApiLocation,
handler: meRoutes.sendInvite(
handler: meRoutes.sendInvite({
config,
storage,
sgMail,
membersCollection,
operationsCollection
)
})
},
{
location: mintApiLocation,
Expand Down
9 changes: 9 additions & 0 deletions packages/server/src/helpers/id.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import cryptoRandomString = require("crypto-random-string");

/**
* Generates an unpredictable identifier. Not globally unique, but pretty
* unlikely to collide.
*/
export function generateId(): string {
return cryptoRandomString(32);
}
Loading