generated from fission-codes/project-template
-
Notifications
You must be signed in to change notification settings - Fork 24
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
User creation and authentication #25
Merged
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
319db1a
wip
icidasset df256c2
wip
icidasset 9383111
wip
icidasset 813a923
got a working jwt
icidasset 70420ba
expire in 10 min
icidasset 0a248f2
create with jwt not did
icidasset 22136e8
check if username is available
icidasset f95d48f
bump keystore-idb version
icidasset 0d52f25
oops
icidasset ef070a2
wip
icidasset 2aa74e0
wip
icidasset a427ebc
wip
icidasset ed980cf
wip
icidasset 87b0216
wip
icidasset 13a5f9c
wip
icidasset 32eddbf
wip
icidasset d4f1ab1
undo publish.sh changes
icidasset c18dbbd
remove unnecessary node-fetch types dependency
icidasset 0d9a814
remove local api endpoint
icidasset 4210db2
return the response instead
icidasset 572ef61
"fix" return type
icidasset fdfe849
there's no files subdomain yet
icidasset b807f41
username validation
icidasset 22487a4
feedback
icidasset 5603407
expose keystore.clear
icidasset 0506c22
ok, ecc is not the same as ed
icidasset dd9ef50
add sync hooks
icidasset 59185f6
version bump
icidasset 25ad323
actually remove the sync hook
icidasset File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
declare module 'base58-universal/main.js' | ||
declare module 'ipld-dag-pb' | ||
declare module 'borc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { KeyStore } from 'keystore-idb/types' | ||
|
||
|
||
// CONSTANTS | ||
|
||
|
||
export const API_ENDPOINT = 'https://runfission.com' | ||
|
||
|
||
|
||
// BASE64 | ||
|
||
|
||
export function base64UrlDecode(a: string): string { | ||
return atob(a).replace(/\_/g, "/").replace(/\-/g, "+") | ||
} | ||
|
||
export function base64UrlEncode(b: string): string { | ||
return makeBase64UrlSafe(btoa(b)) | ||
} | ||
|
||
export function makeBase64UrlSafe(a: string): string { | ||
return a.replace(/\//g, "_").replace(/\+/g, "-").replace(/=+$/, "") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { getKeystore } from './config' | ||
import keystore from 'keystore-idb' | ||
|
||
export const clear = (): Promise<void> => { | ||
return keystore.clear() | ||
} | ||
|
||
export const getKeyByName = async (keyName: string): Promise<string> => { | ||
const ks = await getKeystore() | ||
return ks.exportSymmKey(keyName) | ||
} | ||
|
||
export default { | ||
clear, | ||
getKeyByName | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Added hooks here ☝️