-
Notifications
You must be signed in to change notification settings - Fork 635
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
App passwords #826
App passwords #826
Conversation
@@ -0,0 +1,10 @@ | |||
export interface AppPassword { | |||
accountDid: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issue here at all, but I'm interested to hear whether there's any special reason this is accountDid
rather than just did
, as you might find in some of the other tables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no good reason lol. i'll update it 👍
) | ||
}) | ||
|
||
it('restricts certain actions', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just double-checking that createAppPassword
is the only method we want to restrict in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so? I can't think of any others besides maybe revokeAppPassword
Honestly I'm not even sure we need to restrict createAppPassword
🤔
deleteAccount
requires you to add in your account password anyways
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good call to restrict createAppPassword
👍
@@ -0,0 +1,103 @@ | |||
import AtpAgent from '@atproto/api' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One other case I can think of that might be nice in here is that tokens received after a refresh continue to be restricted as app-password credentials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good call 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
APIs lgtm from the app perspective |
Co-authored-by: devin ivy <[email protected]>
Co-authored-by: devin ivy <[email protected]>
* app password lex & auth chnages * scrypt things * implemented app password refresh tokens * db tidy & migration * revocation + bugfixin * tests, listing passwords & cleanup * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * pr feedback --------- Co-authored-by: devin ivy <[email protected]>
* moderation tweks * fix: typo. (#818) * Create invite codes for many accounts (#825) * create invite codes for many accounts * test * Revamp dev env (#796) * fix up a couple of tsc errors in app view merge * wip * use dev-env for appview tests * process all in blob resolver * another test fix * fixed missed merge conflict * fix one more merge conflict * fix popular test * Sync test env with labeler changes (#836) fix test-env * Remove extraneous info on getRecord (#835) * remove extraneous info on getRecord * fix test-env * Fix duplication of constants in the crypto package (#819) * App passwords (#826) * app password lex & auth chnages * scrypt things * implemented app password refresh tokens * db tidy & migration * revocation + bugfixin * tests, listing passwords & cleanup * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * pr feedback --------- Co-authored-by: devin ivy <[email protected]> * remove profile labels * rm temp branch from workflow --------- Co-authored-by: Devin Ivy <[email protected]> Co-authored-by: S. Ota <[email protected]> Co-authored-by: Ilya Siamionau <[email protected]>
* app password lex & auth chnages * scrypt things * implemented app password refresh tokens * db tidy & migration * revocation + bugfixin * tests, listing passwords & cleanup * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * pr feedback --------- Co-authored-by: devin ivy <[email protected]>
* moderation tweks * fix: typo. (bluesky-social#818) * Create invite codes for many accounts (bluesky-social#825) * create invite codes for many accounts * test * Revamp dev env (bluesky-social#796) * fix up a couple of tsc errors in app view merge * wip * use dev-env for appview tests * process all in blob resolver * another test fix * fixed missed merge conflict * fix one more merge conflict * fix popular test * Sync test env with labeler changes (bluesky-social#836) fix test-env * Remove extraneous info on getRecord (bluesky-social#835) * remove extraneous info on getRecord * fix test-env * Fix duplication of constants in the crypto package (bluesky-social#819) * App passwords (bluesky-social#826) * app password lex & auth chnages * scrypt things * implemented app password refresh tokens * db tidy & migration * revocation + bugfixin * tests, listing passwords & cleanup * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * Update packages/pds/src/db/scrypt.ts Co-authored-by: devin ivy <[email protected]> * pr feedback --------- Co-authored-by: devin ivy <[email protected]> * remove profile labels * rm temp branch from workflow --------- Co-authored-by: Devin Ivy <[email protected]> Co-authored-by: S. Ota <[email protected]> Co-authored-by: Ilya Siamionau <[email protected]>
Implement routes for:
Access tokens from app passwords have a different scope on them (which is a subset of the general "access") & the auth verifier for most routes is augmented to allow requests from both scopes. Some routes - such as account deletion or creating new app passwords - do not allow requests from app passwords.
At the DB layer, we scrypt app passwords using the user's did as a salt. This prevents us from having to scrypt a password (costly operation) many times for many different salts. This still protects against rainbow table attacks.