diff --git a/packages/auth/tests/auth.test.ts b/packages/auth/tests/auth.test.ts index f04ea8664..fc3f2f037 100644 --- a/packages/auth/tests/auth.test.ts +++ b/packages/auth/tests/auth.test.ts @@ -533,7 +533,7 @@ test('profileLookUp', async () => { const mockZonefile = { zonefile: - '$ORIGIN ryan.id\n$TTL 3600\n_http._tcp IN URI 10 1 "https://blockstack.s3.amazonaws.com/ryan.id"\n', + '$ORIGIN ryan.id\n$TTL 3600\n_http._tcp IN URI 10 1 "https://_example_.s3.amazonaws.com/ryan.id"\n', address: 'SP3AMDH2ZZB8XQK467V9HV5CRQF2RPBZ4MDMSBHJZ', }; diff --git a/packages/auth/tests/sampleData.ts b/packages/auth/tests/sampleData.ts index 2ab17ac4d..574b6584c 100644 --- a/packages/auth/tests/sampleData.ts +++ b/packages/auth/tests/sampleData.ts @@ -1,10 +1,10 @@ -import * as fs from 'fs' +import * as fs from 'fs'; -const TEST_DATA_DIR = './tests/testData' +const TEST_DATA_DIR = './tests/testData'; export const sampleNameRecords = { - ryan: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/name-records/ryan.json`, 'utf8')) -} + ryan: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/name-records/ryan.json`, 'utf8')), +}; export const sampleProfiles = { balloonDog: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/balloonDog.json`, 'utf8')), @@ -15,16 +15,16 @@ export const sampleProfiles = { navalLegacy: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval-legacy.json`, 'utf8')), navalLegacyConvert: JSON.parse( fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval-legacy-convert.json`, 'utf8') - ) -} + ), +}; export const sampleTokenFiles = { ryan_apr20: { - url: 'https://blockstack.s3.amazonaws.com/ryan_apr20.id', - body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan_apr20.json`, 'utf8')) + url: 'https://_example_.s3.amazonaws.com/ryan_apr20.id', + body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan_apr20.json`, 'utf8')), }, ryan: { - url: 'https://blockstack.s3.amazonaws.com/ryan.id', - body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan.json`, 'utf8')) - } -} + url: 'https://_example_.s3.amazonaws.com/ryan.id', + body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan.json`, 'utf8')), + }, +}; diff --git a/packages/auth/tests/testData/profiles/larry.json b/packages/auth/tests/testData/profiles/larry.json index e12a832fc..7fc36508d 100644 --- a/packages/auth/tests/testData/profiles/larry.json +++ b/packages/auth/tests/testData/profiles/larry.json @@ -1,61 +1,61 @@ { - "@type": "Person", - "account": [ - { - "@type": "Account", - "identifier": "larrysalibra", - "proofType": "http", - "service": "twitter" - }, - { - "@type": "Account", - "identifier": "larrysalibra", - "proofType": "http", - "service": "github" - }, - { - "@type": "Account", - "identifier": "1EyuZ8qxdhHjcnTChwQLyQaN3cmdK55DkH", - "role": "payment", - "service": "bitcoin" - }, - { - "@type": "Account", - "contentUrl": "http://pgp.mit.edu/pks/lookup?op=get&search=0xDE3B5425164C4849", - "identifier": "B516CB7A08819697B25E4694DE3B5425164C4849", - "role": "key", - "service": "pgp" - }, - { - "@type": "Account", - "identifier": "larry.salibra", - "proofType": "http", - "proofUrl": "https://www.facebook.com/larry.salibra/posts/10100341028448093", - "service": "facebook" - } - ], - "address": { - "@type": "PostalAddress", - "addressLocality": "Hong Kong" + "@type": "Person", + "account": [ + { + "@type": "Account", + "identifier": "larrysalibra", + "proofType": "http", + "service": "twitter" }, - "description": "Blockchain, software, security. Decentralize the world (w/ #bitcoin)! \u8b58\u4e2d\u6587", - "image": [ - { - "@type": "ImageObject", - "contentUrl": "https://s3.amazonaws.com/kd4/larry", - "name": "avatar" - }, - { - "@type": "ImageObject", - "contentUrl": "https://s3.amazonaws.com/dx3/larry", - "name": "cover" - } - ], - "name": "Larry Salibra", - "website": [ - { - "@type": "WebSite", - "url": "https://www.larrysalibra.com" - } - ] + { + "@type": "Account", + "identifier": "larrysalibra", + "proofType": "http", + "service": "github" + }, + { + "@type": "Account", + "identifier": "1EyuZ8qxdhHjcnTChwQLyQaN3cmdK55DkH", + "role": "payment", + "service": "bitcoin" + }, + { + "@type": "Account", + "contentUrl": "http://pgp.mit.edu/pks/lookup?op=get&search=0xDE3B5425164C4849", + "identifier": "B516CB7A08819697B25E4694DE3B5425164C4849", + "role": "key", + "service": "pgp" + }, + { + "@type": "Account", + "identifier": "larry.salibra", + "proofType": "http", + "proofUrl": "https://www.facebook.com/larry.salibra/posts/10100341028448093", + "service": "facebook" + } + ], + "address": { + "@type": "PostalAddress", + "addressLocality": "Hong Kong" + }, + "description": "Blockchain, software, security. Decentralize the world (w/ #bitcoin)! \u8b58\u4e2d\u6587", + "image": [ + { + "@type": "ImageObject", + "contentUrl": "https://s3.amazonaws.com/_example_/larry", + "name": "avatar" + }, + { + "@type": "ImageObject", + "contentUrl": "https://s3.amazonaws.com/_example_/larry", + "name": "cover" + } + ], + "name": "Larry Salibra", + "website": [ + { + "@type": "WebSite", + "url": "https://www.larrysalibra.com" + } + ] } diff --git a/packages/auth/tests/testData/profiles/naval-legacy-convert.json b/packages/auth/tests/testData/profiles/naval-legacy-convert.json index edc963738..2983754f5 100644 --- a/packages/auth/tests/testData/profiles/naval-legacy-convert.json +++ b/packages/auth/tests/testData/profiles/naval-legacy-convert.json @@ -59,7 +59,7 @@ "role": "key", "service": "pgp", "identifier": "07354EDF5C6CF2572847840D8FA3F960B62B7C41", - "contentUrl": "https://s3.amazonaws.com/pk9/naval" + "contentUrl": "https://s3.amazonaws.com/_example_/naval" } ] }, diff --git a/packages/auth/tests/testData/profiles/naval-legacy.json b/packages/auth/tests/testData/profiles/naval-legacy.json index b51e21e65..91560419c 100644 --- a/packages/auth/tests/testData/profiles/naval-legacy.json +++ b/packages/auth/tests/testData/profiles/naval-legacy.json @@ -19,7 +19,7 @@ }, "website": "https://angel.co/naval", "pgp": { - "url": "https://s3.amazonaws.com/pk9/naval", + "url": "https://s3.amazonaws.com/_example_/naval", "fingerprint": "07354EDF5C6CF2572847840D8FA3F960B62B7C41" }, "v": "0.2", @@ -28,7 +28,7 @@ }, "twitterUsername": "naval", "graph": { - "url": "https://s3.amazonaws.com/grph/naval" + "url": "https://s3.amazonaws.com/_example_/naval" }, "cover": { "url": "https://pbs.twimg.com/profile_banners/745273/1355705777/web_retina" @@ -46,4 +46,4 @@ "location": { "formatted": "San Francisco, CA" } -} \ No newline at end of file +} diff --git a/packages/auth/tests/testData/profiles/ryan.json b/packages/auth/tests/testData/profiles/ryan.json index 174796402..505ceb4fc 100644 --- a/packages/auth/tests/testData/profiles/ryan.json +++ b/packages/auth/tests/testData/profiles/ryan.json @@ -1,69 +1,69 @@ { - "@type": "Person", + "@type": "Person", "account": [ { - "service": "bitcoin", - "@type": "Account", - "identifier": "1LFS37yRSibwbf8CnXeCn5t1GKeTEZMmu9", + "service": "bitcoin", + "@type": "Account", + "identifier": "1LFS37yRSibwbf8CnXeCn5t1GKeTEZMmu9", "role": "payment" - }, + }, { - "service": "pgp", - "contentUrl": "https://s3.amazonaws.com/pk9/ryan", - "@type": "Account", + "service": "pgp", + "contentUrl": "https://s3.amazonaws.com/_example_/ryan", + "@type": "Account", "identifier": "1E4329E6634C75730D4D88C0638F2769D55B9837" - }, + }, { - "service": "openbazaar", - "proofType": "http", - "@type": "Account", - "proofUrl": "https://www.facebook.com/msrobot0/posts/10153644446452759", + "service": "openbazaar", + "proofType": "http", + "@type": "Account", + "proofUrl": "https://www.facebook.com/msrobot0/posts/10153644446452759", "identifier": "f2250123a6af138c86b30f3233b338961dc8fbc3" - }, + }, { - "service": "twitter", - "proofType": "http", - "@type": "Account", - "proofUrl": "https://twitter.com/ryaneshea/status/765575388735082496", + "service": "twitter", + "proofType": "http", + "@type": "Account", + "proofUrl": "https://twitter.com/ryaneshea/status/765575388735082496", "identifier": "ryaneshea" - }, + }, { - "service": "github", - "proofType": "http", - "@type": "Account", - "proofUrl": "https://gist.github.com/shea256/a6dc1f3182f28bb2285feaef07a14340", + "service": "github", + "proofType": "http", + "@type": "Account", + "proofUrl": "https://gist.github.com/shea256/a6dc1f3182f28bb2285feaef07a14340", "identifier": "shea256" - }, + }, { - "service": "facebook", - "proofType": "http", - "@type": "Account", - "proofUrl": "https://www.facebook.com/ryaneshea/posts/10154182997407713", + "service": "facebook", + "proofType": "http", + "@type": "Account", + "proofUrl": "https://www.facebook.com/ryaneshea/posts/10154182997407713", "identifier": "ryaneshea" } - ], + ], "website": [ { - "@type": "WebSite", + "@type": "WebSite", "url": "http://shea.io" } - ], - "description": "Co-founder of Blockstack Inc.", - "name": "Ryan Shea", + ], + "description": "Co-founder of Blockstack Inc.", + "name": "Ryan Shea", "address": { - "@type": "PostalAddress", + "@type": "PostalAddress", "addressLocality": "New York" - }, + }, "image": [ { - "@type": "ImageObject", - "contentUrl": "https://s3.amazonaws.com/kd4/ryan", + "@type": "ImageObject", + "contentUrl": "https://s3.amazonaws.com/_example_/ryan", "name": "avatar" - }, + }, { - "@type": "ImageObject", - "contentUrl": "https://s3.amazonaws.com/dx3/ryan", + "@type": "ImageObject", + "contentUrl": "https://s3.amazonaws.com/_example_/ryan", "name": "cover" } ] -} \ No newline at end of file +} diff --git a/packages/auth/tests/testData/token-files/ryan.json b/packages/auth/tests/testData/token-files/ryan.json index c1179406e..e78459d51 100644 --- a/packages/auth/tests/testData/token-files/ryan.json +++ b/packages/auth/tests/testData/token-files/ryan.json @@ -2,92 +2,92 @@ { "decodedToken": { "header": { - "alg": "ES256K", + "alg": "ES256K", "typ": "JWT" - }, + }, "payload": { - "issuedAt": "2016-12-21T02:20:24.575047", + "issuedAt": "2016-12-21T02:20:24.575047", "claim": { "image": [ { - "contentUrl": "https://s3.amazonaws.com/kd4/ryan", - "name": "avatar", + "contentUrl": "https://s3.amazonaws.com/_example_/ryan", + "name": "avatar", "@type": "ImageObject" - }, + }, { - "contentUrl": "https://s3.amazonaws.com/dx3/ryan", - "name": "cover", + "contentUrl": "https://s3.amazonaws.com/_example_/ryan", + "name": "cover", "@type": "ImageObject" } - ], - "@type": "Person", + ], + "@type": "Person", "website": [ { - "url": "http://shea.io", + "url": "http://shea.io", "@type": "WebSite" } - ], - "description": "Co-founder of Blockstack Inc.", + ], + "description": "Co-founder of Blockstack Inc.", "address": { - "addressLocality": "New York", + "addressLocality": "New York", "@type": "PostalAddress" - }, + }, "account": [ { - "identifier": "1LFS37yRSibwbf8CnXeCn5t1GKeTEZMmu9", - "role": "payment", - "@type": "Account", + "identifier": "1LFS37yRSibwbf8CnXeCn5t1GKeTEZMmu9", + "role": "payment", + "@type": "Account", "service": "bitcoin" - }, + }, { - "contentUrl": "https://s3.amazonaws.com/pk9/ryan", - "identifier": "1E4329E6634C75730D4D88C0638F2769D55B9837", - "@type": "Account", + "contentUrl": "https://s3.amazonaws.com/_example_/ryan", + "identifier": "1E4329E6634C75730D4D88C0638F2769D55B9837", + "@type": "Account", "service": "pgp" - }, + }, { - "identifier": "f2250123a6af138c86b30f3233b338961dc8fbc3", - "proofType": "http", - "proofUrl": "https://www.facebook.com/msrobot0/posts/10153644446452759", - "service": "openbazaar", + "identifier": "f2250123a6af138c86b30f3233b338961dc8fbc3", + "proofType": "http", + "proofUrl": "https://www.facebook.com/msrobot0/posts/10153644446452759", + "service": "openbazaar", "@type": "Account" - }, + }, { - "identifier": "ryaneshea", - "proofType": "http", - "proofUrl": "https://twitter.com/ryaneshea/status/765575388735082496", - "service": "twitter", + "identifier": "ryaneshea", + "proofType": "http", + "proofUrl": "https://twitter.com/ryaneshea/status/765575388735082496", + "service": "twitter", "@type": "Account" - }, + }, { - "identifier": "shea256", - "proofType": "http", - "proofUrl": "https://gist.github.com/shea256/a6dc1f3182f28bb2285feaef07a14340", - "service": "github", + "identifier": "shea256", + "proofType": "http", + "proofUrl": "https://gist.github.com/shea256/a6dc1f3182f28bb2285feaef07a14340", + "service": "github", "@type": "Account" - }, + }, { - "identifier": "ryaneshea", - "proofType": "http", - "proofUrl": "https://www.facebook.com/ryaneshea/posts/10154182997407713", - "service": "facebook", + "identifier": "ryaneshea", + "proofType": "http", + "proofUrl": "https://www.facebook.com/ryaneshea/posts/10154182997407713", + "service": "facebook", "@type": "Account" } - ], + ], "name": "Ryan Shea" - }, - "expiresAt": "2017-12-21T02:20:24.575047", + }, + "expiresAt": "2017-12-21T02:20:24.575047", "subject": { "publicKey": "0312ccf3255cb005e42c186aa3d2302083b306a52c1f0cb47b1119639f134e6695" - }, + }, "issuer": { "publicKey": "0312ccf3255cb005e42c186aa3d2302083b306a52c1f0cb47b1119639f134e6695" } - }, + }, "signature": "YVoNsoJCTMcXIwqa9D5kinkUrnyppsYus7Z-8cn7o9hA6_IG9zkoZGSvsIzfqqjG1mV8JNV1Nh04CZl1qrt1YQ" - }, - "token": "eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJpc3N1ZWRBdCI6IjIwMTYtMTItMjFUMDI6MjA6MjQuNTc1MDQ3IiwiY2xhaW0iOnsiaW1hZ2UiOlt7ImNvbnRlbnRVcmwiOiJodHRwczovL3MzLmFtYXpvbmF3cy5jb20va2Q0L3J5YW4iLCJuYW1lIjoiYXZhdGFyIiwiQHR5cGUiOiJJbWFnZU9iamVjdCJ9LHsiY29udGVudFVybCI6Imh0dHBzOi8vczMuYW1hem9uYXdzLmNvbS9keDMvcnlhbiIsIm5hbWUiOiJjb3ZlciIsIkB0eXBlIjoiSW1hZ2VPYmplY3QifV0sIkB0eXBlIjoiUGVyc29uIiwid2Vic2l0ZSI6W3sidXJsIjoiaHR0cDovL3NoZWEuaW8iLCJAdHlwZSI6IldlYlNpdGUifV0sImFjY291bnQiOlt7ImlkZW50aWZpZXIiOiIxTEZTMzd5UlNpYndiZjhDblhlQ241dDFHS2VURVpNbXU5Iiwicm9sZSI6InBheW1lbnQiLCJAdHlwZSI6IkFjY291bnQiLCJzZXJ2aWNlIjoiYml0Y29pbiJ9LHsiY29udGVudFVybCI6Imh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vZlVybCI6Imh0dHBzOi8vd3d3LmZhY2Vib29rLmNvbS9yeWFuZXNoZWEvcG9zdHMvMTAxNTQxODI5OTc0MDc3MTMiLCJzZXJ2aWNlIjoiZmFjZWJvb2siLCJAdHlwZSI6IkFjY291bnQifV0sImFkZHJlc3MiOnsiYWRkcmVzc0xvY2FsaXR5IjoiTmV3IFlvcmsiLCJAdHlwZSI6IlBvc3RhbEFkZHJlc3MifSwiZGVzY3JpcHRpb24iOiJDby1mb3VuZGVyIG9mIEJsb2Nrc3RhY2sgSW5jLiIsIm5hbWUiOiJSeWFuIFNoZWEifSwiZXhwaXJlc0F0IjoiMjAxNy0xMi0yMVQwMjoyMDoyNC41NzUwNDciLCJpc3N1ZXIiOnsicHVibGljS2V5IjoiMDMxMmNjZjMyNTVjYjAwNWU0MmMxODZhYTNkMjMwMjA4M2IzMDZhNTJjMWYwY2I0N2IxMTE5NjM5ZjEzNGU2Njk1In0sInN1YmplY3QiOnsicHVibGljS2V5IjoiMDMxMmNjZjMyNTVjYjAwNWU0MmMxODZhYTNkMjMwMjA4M2IzMDZhNTJjMWYwY2I0N2IxMTE5NjM5ZjEzNGU2Njk1In19.YVoNsoJCTMcXIwqa9D5kinkUrnyppsYus7Z-8cn7o9hA6_IG9zkoZGSvsIzfqqjG1mV8JNV1Nh04CZl1qrt1YQ", + "parentPublicKey": "0312ccf3255cb005e42c186aa3d2302083b306a52c1f0cb47b1119639f134e6695", "encrypted": false } -] \ No newline at end of file +] diff --git a/packages/auth/tests/testData/token-files/ryan_apr20.json b/packages/auth/tests/testData/token-files/ryan_apr20.json index 226094005..a397a4749 100644 --- a/packages/auth/tests/testData/token-files/ryan_apr20.json +++ b/packages/auth/tests/testData/token-files/ryan_apr20.json @@ -2,42 +2,42 @@ { "decodedToken": { "header": { - "alg": "ES256K", + "alg": "ES256K", "typ": "JWT" - }, + }, "payload": { - "issuedAt": "2016-04-20T12:25:14.453734", + "issuedAt": "2016-04-20T12:25:14.453734", "claim": { - "account": [], - "accounts": [], - "@type": "Person", + "account": [], + "accounts": [], + "@type": "Person", "image": [ { - "contentUrl": "https://s3.amazonaws.com/97p/rv1.jpeg", - "@type": "ImageObject", + "contentUrl": "https://s3.amazonaws.com/_example_/rv1.jpeg", + "@type": "ImageObject", "name": "cover" - }, + }, { - "contentUrl": "https://s3.amazonaws.com/kd4/ryan_apr20", - "@type": "ImageObject", + "contentUrl": "https://s3.amazonaws.com/_example_/ryan_apr20", + "@type": "ImageObject", "name": "avatar" } - ], + ], "name": "Ryan Shea" - }, - "expiresAt": "2017-04-20T12:25:14.453734", + }, + "expiresAt": "2017-04-20T12:25:14.453734", "subject": { "publicKey": "02413d7c51118104cfe1b41e540b6c2acaaf91f1e2e22316df7448fb6070d582ec" - }, + }, "issuer": { "publicKey": "02413d7c51118104cfe1b41e540b6c2acaaf91f1e2e22316df7448fb6070d582ec" } - }, + }, "signature": "Xj3z975ccW6oxbrlm_YsdGNreuzERRxPoj0DyyJ9vygMYfUjsTQGcxsejmkSPYafTFd6TNIbNBTquutOKZvmBA" - }, - "token": "eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJpc3N1ZWRBdCI6IjIwMTYtMDQtMjBUMTI6MjU6MTQuNDUzNzM0IiwiY2xhaW0iOnsiYWNjb3VudCI6W10sImFjY291bnRzIjpbXSwiQHR5cGUiOiJQZXJzb24iLCJpbWFnZSI6W3siY29udGVudFVybCI6Imh0dHBzOi8vczMuYW1hem9uYXdzLmNvbS85N3AvcnYxLmpwZWciLCJAdHlwZSI6IkltYWdlT2JqZWN0IiwibmFtZSI6ImNvdmVyIn0seyJjb250ZW50VXJsIjoiaHR0cHM6Ly9zMy5hbWF6b25hd3MuY29tL2tkNC9yeWFuX2FwcjIwIiwiQHR5cGUiOiJJbWFnZU9iamVjdCIsIm5hbWUiOiJhdmF0YXIifV0sIm5hbWUiOiJSeWFuIFNoZWEifSwiZXhwaXJlc0F0IjoiMjAxNy0wNC0yMFQxMjoyNToxNC40NTM3MzQiLCJpc3N1ZXIiOnsicHVibGljS2V5IjoiMDI0MTNkN2M1MTExODEwNGNmZTFiNDFlNTQwYjZjMmFjYWFmOTFmMWUyZTIyMzE2ZGY3NDQ4ZmI2MDcwZDU4MmVjIn0sInN1YmplY3QiOnsicHVibGljS2V5IjoiMDI0MTNkN2M1MTExODEwNGNmZTFiNDFlNTQwYjZjMmFjYWFmOTFmMWUyZTIyMzE2ZGY3NDQ4ZmI2MDcwZDU4MmVjIn19.Xj3z975ccW6oxbrlm_YsdGNreuzERRxPoj0DyyJ9vygMYfUjsTQGcxsejmkSPYafTFd6TNIbNBTquutOKZvmBA", - "parentPublicKey": "02413d7c51118104cfe1b41e540b6c2acaaf91f1e2e22316df7448fb6070d582ec", - "publicKey": "02413d7c51118104cfe1b41e540b6c2acaaf91f1e2e22316df7448fb6070d582ec", + }, + "token": "eyJhbGciOiJFUzI1NksiLCJ0eXAiOiJKV1QifQ.eyJpc3N1ZWRBdCI6IjIwMTYtMDQtMjBUMTI6MjU6MTQuNDUzNzM0IiwiY2xhaW0iOnsiYWNjb3VudCI6W10sImFjY291bnRzIjpbXSwiQHR5cGUiOiJQZXJzb24iLCJpbWFnZSI6W3siY29udGVudFVybCI6Imh0dHBzOi8vczMuYW1hem9uYXdzLmNvbS85N3AvcnYxLmpwZWciLCJAdHlwZSI6IkltYWdlT2JqZWN0IiwibmFtZSI6ImNvdmVyIn0seyJjb250ZW50VXJsIjoiaHR0cHM6Ly9zMy5hbWF6b25hd3MuY29tL2tkNC9yeWFuX2FwcjIwIiwiQHR5cGUiOiJJbWFnZU9iamVjdCIsIm5hbWUiOiJhdmF0YXIifV0sIm5hbWUiOiJSeWFuIFNoZWEifSwiZXhwaXJlc0F0IjoiMjAxNy0wNC0yMFQxMjoyNToxNC40NTM3MzQiLCJpc3N1ZXIiOnsicHVibGljS2V5IjoiMDI0MTNkN2M1MTExODEwNGNmZTFiNDFlNTQwYjZjMmFjYWFmOTFmMWUyZTIyMzE2ZGY3NDQ4ZmI2MDcwZDU4MmVjIn0sInN1YmplY3QiOnsicHVibGljS2V5IjoiMDI0MTNkN2M1MTExODEwNGNmZTFiNDFlNTQwYjZjMmFjYWFmOTFmMWUyZTIyMzE2ZGY3NDQ4ZmI2MDcwZDU4MmVjIn19.Xj3z975ccW6oxbrlm_YsdGNreuzERRxPoj0DyyJ9vygMYfUjsTQGcxsejmkSPYafTFd6TNIbNBTquutOKZvmBA", + "parentPublicKey": "02413d7c51118104cfe1b41e540b6c2acaaf91f1e2e22316df7448fb6070d582ec", + "publicKey": "02413d7c51118104cfe1b41e540b6c2acaaf91f1e2e22316df7448fb6070d582ec", "encrypted": false } -] \ No newline at end of file +] diff --git a/packages/profile/README.md b/packages/profile/README.md index f4cc009e0..972cc2a45 100644 --- a/packages/profile/README.md +++ b/packages/profile/README.md @@ -39,11 +39,12 @@ const decodedToken = verifyProfileToken(token, publicKey); ```typescript import { makeProfileZoneFile } from '@stacks/profile'; -const fileUrl = 'https://mq9.s3.amazonaws.com/naval.id/profile.json'; +const fileUrl = 'https://_example_.s3.amazonaws.com/naval.id/profile.json'; const origin = 'naval.id'; const zoneFile = makeProfileZoneFile(origin, fileUrl); // zoneFile contents ``` + ### Profile to token ```typescript @@ -52,7 +53,7 @@ import { signProfileToken, verifyProfileToken, extractProfile } from '@stacks/pr // Token received after signin in browser using auth or connect const token = ''; const profile = extractProfile(token); -// warning: Do not expose your private key by hard coding in code. Use env variables to load private keys. +// warning: Do not expose your private key by hard coding in code. Use env variables to load private keys. const privateKey = ''; // process.env.privateKey const publicKey = ''; diff --git a/packages/profile/tests/sampleData.ts b/packages/profile/tests/sampleData.ts index fba4b391d..efe505c27 100644 --- a/packages/profile/tests/sampleData.ts +++ b/packages/profile/tests/sampleData.ts @@ -1,6 +1,6 @@ -import * as fs from 'fs' +import * as fs from 'fs'; -const TEST_DATA_DIR = './tests/testData' +const TEST_DATA_DIR = './tests/testData'; export const sampleManifests = { helloBlockstack: { @@ -14,15 +14,15 @@ export const sampleManifests = { { src: 'https://raw.githubusercontent.com/blockstack/blockstack-portal/master/app/images/app-hello-blockstack.png', sizes: '192x192', - type: 'image/png' - } - ] - } -} + type: 'image/png', + }, + ], + }, +}; export const sampleNameRecords = { - ryan: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/name-records/ryan.json`, 'utf8')) -} + ryan: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/name-records/ryan.json`, 'utf8')), +}; export const sampleProfiles = { balloonDog: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/balloonDog.json`, 'utf8')), @@ -33,94 +33,100 @@ export const sampleProfiles = { navalLegacy: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval-legacy.json`, 'utf8')), navalLegacyConvert: JSON.parse( fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval-legacy-convert.json`, 'utf8') - ) -} + ), +}; export const sampleTokenFiles = { ryan_apr20: { - url: 'https://blockstack.s3.amazonaws.com/ryan_apr20.id', - body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan_apr20.json`, 'utf8')) + url: 'https://_example_.s3.amazonaws.com/ryan_apr20.id', + body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan_apr20.json`, 'utf8')), }, ryan: { - url: 'https://blockstack.s3.amazonaws.com/ryan.id', - body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan.json`, 'utf8')) - } -} + url: 'https://_example_.s3.amazonaws.com/ryan.id', + body: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/token-files/ryan.json`, 'utf8')), + }, +}; export const sampleProofs = { naval: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval.proofs.json`, 'utf8')), larry: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/larry.proofs.json`, 'utf8')), ken: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.proofs.json`, 'utf8')), - bruno: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/bruno.proofs.json`, 'utf8')) -} + bruno: JSON.parse(fs.readFileSync(`${TEST_DATA_DIR}/profiles/bruno.proofs.json`, 'utf8')), +}; export const sampleVerifications = { naval: { facebook: { url: 'https://www.facebook.com/navalr/posts/10152190734077261', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval.verification.facebook.html`, 'utf8') + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval.verification.facebook.html`, 'utf8'), }, github: { url: 'https://gist.github.com/navalr/f31a74054f859ec0ac6a', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval.verification.github.html`, 'utf8') + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval.verification.github.html`, 'utf8'), }, twitter: { url: 'https://twitter.com/naval/status/486609266212499456', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval.verification.twitter.html`, 'utf8') - } + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/naval.verification.twitter.html`, 'utf8'), + }, }, larry: { facebook: { url: 'https://www.facebook.com/larry.salibra/posts/10100341028448093', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/larry.verification.facebook.html`, 'utf8') - } - } -} + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/larry.verification.facebook.html`, 'utf8'), + }, + }, +}; export const sampleAddressBasedVerifications = { larry: { facebook: { url: 'https://www.facebook.com/larrysalibra/posts/10100341028448094', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/larry.verification.address.facebook.html`, - 'utf8') - } + body: fs.readFileSync( + `${TEST_DATA_DIR}/profiles/larry.verification.address.facebook.html`, + 'utf8' + ), + }, }, ken: { github: { url: 'https://gist.github.com/yknl/37c763ab7bc6cf89b919212ef3f10676', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.github.html`, 'utf8') + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.github.html`, 'utf8'), }, twitter: { url: 'https://twitter.com/YukanL/status/903285763240022017', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.twitter.html`, 'utf8') + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.twitter.html`, 'utf8'), }, instagram: { url: 'https://www.instagram.com/p/BYj6UDwgaX7/', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.instagram.html`, 'utf8') + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.instagram.html`, 'utf8'), }, instagramRegression: { url: 'https://www.instagram.com/p/BYj6UDwgaX7/', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/` - + 'ken.verification.instagram.regression.html', 'utf8') + body: fs.readFileSync( + `${TEST_DATA_DIR}/profiles/` + 'ken.verification.instagram.regression.html', + 'utf8' + ), }, hackerNews: { url: 'https://news.ycombinator.com/user?id=yukanl', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.hackernews.html`, 'utf8') + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.hackernews.html`, 'utf8'), }, linkedIn: { url: 'https://www.linkedin.com/feed/update/urn:li:activity:6311587377647222784/', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.linkedin.html`, 'utf8') + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.linkedin.html`, 'utf8'), }, linkedInBroken: { url: 'https://www.linkedin.com/feed/update/urn:li:activity:6311587377647222784/', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/ken.verification.linkedinbroken.html`, - 'utf8') - } + body: fs.readFileSync( + `${TEST_DATA_DIR}/profiles/ken.verification.linkedinbroken.html`, + 'utf8' + ), + }, }, oscar: { linkedIn: { url: 'https://www.linkedin.com/feed/update/urn:li:activity:6504006525630189568/', - body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/oscar.verification.linkedin.html`, 'utf8') - } - } -} + body: fs.readFileSync(`${TEST_DATA_DIR}/profiles/oscar.verification.linkedin.html`, 'utf8'), + }, + }, +}; diff --git a/packages/profile/tests/schema.test.ts b/packages/profile/tests/schema.test.ts index 203f44529..aa37cd639 100644 --- a/packages/profile/tests/schema.test.ts +++ b/packages/profile/tests/schema.test.ts @@ -88,7 +88,7 @@ test('legacyFormat', () => { test('resolveZoneFileToPerson', () => { const zoneFile = - '$ORIGIN ryan.id\n$TTL 3600\n_http._tcp IN URI 10 1 "https://blockstack.s3.amazonaws.com/ryan.id"\n'; + '$ORIGIN ryan.id\n$TTL 3600\n_http._tcp IN URI 10 1 "https://_example_.s3.amazonaws.com/ryan.id"\n'; const ownerAddress = 'SP3AMDH2ZZB8XQK467V9HV5CRQF2RPBZ4MDMSBHJZ'; fetchMock.once(JSON.stringify(sampleTokenFiles.ryan.body)); diff --git a/packages/profile/tests/testData/profiles/ken.verification.github.html b/packages/profile/tests/testData/profiles/ken.verification.github.html index 82ff0a5ad..736b9c625 100644 --- a/packages/profile/tests/testData/profiles/ken.verification.github.html +++ b/packages/profile/tests/testData/profiles/ken.verification.github.html @@ -1,508 +1,1069 @@ - + - - - - - - - - - - - - - - - - - - - - - - Verify · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + Verify · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - -
- Skip to content -
- - - - - - - -