Skip to content

Commit

Permalink
chore: revert console.logs used for debugging staging
Browse files Browse the repository at this point in the history
  • Loading branch information
travis committed Jul 18, 2023
1 parent ac5d2f6 commit 2c279cd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
10 changes: 1 addition & 9 deletions test/helpers/up-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getAuthLinkFromEmail (email, uploadServiceUrl) {
// forgive me for I have s̵i̵n̴n̴e̵d̴ ̸a̸n̵d̷ ̷p̶a̵r̵s̵e̸d̷ Ȟ̷̞T̷̢̈́M̸̼̿L̴̎ͅ ̵̗̍ẅ̵̝́ï̸ͅt̴̬̅ḫ̸̔ ̵͚̔ŗ̵͊e̸͍͐g̶̜͒ė̷͖x̴̱̌
// TODO we should update the email and add an ID to this element to make this more robust - tracked in https://github.com/web3-storage/w3infra/issues/208
const link = email.match(/<a href="([^"]*)".*Verify email address/)[1]
console.log(`found auth ink ${link}`)

// test auth services always link to the staging URL but we want to hit the service we're testing
return link.replace("https://w3access-staging.protocol-labs.workers.dev", uploadServiceUrl)
}
Expand All @@ -33,9 +33,7 @@ async function createMailSlurpInbox() {

export async function setupNewClient (uploadServiceUrl, options = {}) {
// create an inbox
console.log("creating mailslurp inbox ")
const { mailslurp, id: inboxId, email } = await createMailSlurpInbox()
console.log(`creating agent with upload service url ${uploadServiceUrl}`)
const principal = await Signer.generate()
const data = await AgentData.create({ principal })
const client = new Client(data, {
Expand All @@ -48,22 +46,16 @@ export async function setupNewClient (uploadServiceUrl, options = {}) {
const timeoutMs = process.env.MAILSLURP_TIMEOUT ? parseInt(process.env.MAILSLURP_TIMEOUT) : 60_000
const authorizePromise = client.authorize(email)
// click link in email
console.log("waiting for an email from mailslurp")
const latestEmail = await mailslurp.waitForLatestEmail(inboxId, timeoutMs)
const authLink = getAuthLinkFromEmail(latestEmail.body, uploadServiceUrl)
console.log(`fetching auth link ${authLink}`)
await fetch(authLink, { method: 'POST' })
console.log("waiting for authorize to return")
await authorizePromise
if (!client.currentSpace()) {
console.log("creating a new space")
const space = await client.createSpace("test space")
await client.setCurrentSpace(space.did())
console.log("registering a new space")
await client.registerSpace(email)
}

console.log("new client created and set up!")
return client
}

Expand Down
3 changes: 0 additions & 3 deletions upload-api/functions/ucan-invocation-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ export async function ucanInvocationRouter(request) {
}
}

console.log(`using access service at ${accessServiceURL}`)
console.log(`using r2 delegations bucket at ${r2DelegationBucketEndpoint} ${r2DelegationBucketName}`)

const { UPLOAD_API_DID } = process.env
const { PRIVATE_KEY } = Config
const serviceSigner = getServiceSigner({ UPLOAD_API_DID, PRIVATE_KEY })
Expand Down

0 comments on commit 2c279cd

Please sign in to comment.