profile
viewpoint
Phil Nash philnash @twilio Melbourne https://philna.sh Developer evangelist for @twilio, @authy and @sendgrid. I write mostly JavaScript and Ruby. Probably listening to ska punk right now. console.log("🍻")

bubenshchykov/ngrok 1883

Expose your localhost to the web. Node wrapper for ngrok.

philnash/bitly 438

A Ruby wrapper for the bit.ly API

philnash/bulk-sms-alerts 28

An example of sending one, a few and many SMS messages using the Twilio APi

mplacona/twilio-pa 13

Your own personal assistant powered by Twilio

dkundel/2fa-wtf 6

What 2FA is all about, how to use it and how to implement it.

dstrelau/webrat 6

Webrat fork with support for Culerity from jnicklas

dkundel/twilio-nes-arcade 5

🎮 Play NES games with emojis

philnash/advent-of-code 3

Advent of Code 2017-2020 solutions in Crystal

dev-manager-uk/twiliohoho 2

An Open-Source PBX-Like Phone System for Twilio SIP Domains Built in node.js and Hosted on Heroku.

philnash/authy-devise 2

Authy Devise plugin to add Two-Factor Authentication

pull request commentfirebase/firebase-tools

Corrects validation of secrets in extension installation

Updated those two bits @joehan.

philnash

comment created time in 2 days

push eventphilnash/firebase-tools

Cole Rogers

commit sha 0d6d6322973a050395f07a6c0f0418e8d1aeff5e

GCS fixes (#3854) * adding service account api calls * fixing edge case for function regions/buckets/triggers, added code to set the iam role on storage service agent * spacing * adding reducer to clean up code * fix additional edge cases * addressing comments * cleaning up names * exposing more location apis and clean up * linter * refactor into services file * fixing comments * clean up sinon stubs * changing dispatch function to undefined for noop & pubsub services * linter

view details

Phil Nash

commit sha 925f367a35c01fbe10f7dc31265dbd2ea7cf87bd

Merge branch 'master' into extensions-secret-validation

view details

push time in 2 days

push eventphilnash/firebase-tools

Phil Nash

commit sha d707361b3e3f42b14a737ed2afed3e22308e8145

Adds entry to Changelog

view details

push time in 2 days

push eventphilnash/firebase-tools

Cole Rogers

commit sha da5a2d62560837efa674a0aebfbbb0875c264015

GCS fixes (#3854) * adding service account api calls * fixing edge case for function regions/buckets/triggers, added code to set the iam role on storage service agent * spacing * adding reducer to clean up code * fix additional edge cases * addressing comments * cleaning up names * exposing more location apis and clean up * linter * refactor into services file * fixing comments * clean up sinon stubs * changing dispatch function to undefined for noop & pubsub services * linter

view details

Phil Nash

commit sha f1dbe54e11163bbbc9e9473bb7f61833bb4ce553

Change conditional back to a ternary

view details

push time in 2 days

push eventphilnash/firebase-tools

Phil Hess

commit sha d1497b79c5d51834e03cd7a8a3bdfc0bfc3c198f

Pin cli-table dependency to v0.3.6 (#3907) * Pin cli-table dependency to v0.3.6 * Update package-lock. Add newline

view details

Bryan Kendall

commit sha dcfaeafd8101150c3cee5b9d0cafee203722d6f6

dependency updates (#3897) * upgrade top level uuid dependency * upgrade depdencies using npm audit * commit missing package-lock changes * fix one usage of uuid

view details

Thomas Bouldin

commit sha d314151473f80870c517fcff83bcae8b5022639a

Turn on AR experiment for all clients. (#3911) * Turn on AR experiment for all clients. After some limited internal testing, we believe that we're ready for a rollout that is only controlled by the server. The code has to be ready to always request AR but sometimes be on GCR. This means that we clean up GCR images and also that we handle 404s from AR. * Revert package*

view details

Bryan Kendall

commit sha afec8b49869c5adf96c2b6e2eb265a74bacebbfc

upgrade cli-table beyond the broken version (#3912)

view details

Google Open Source Bot

commit sha af8355f175772c652970b083dfaa6e2b9f5b1fb6

9.23.0

view details

Google Open Source Bot

commit sha 832242dd0a8b4965f671dd8070a70ea173244dc9

[firebase-release] Removed change log and reset repo after 9.23.0 release

view details

Cole Rogers

commit sha 0d6d6322973a050395f07a6c0f0418e8d1aeff5e

GCS fixes (#3854) * adding service account api calls * fixing edge case for function regions/buckets/triggers, added code to set the iam role on storage service agent * spacing * adding reducer to clean up code * fix additional edge cases * addressing comments * cleaning up names * exposing more location apis and clean up * linter * refactor into services file * fixing comments * clean up sinon stubs * changing dispatch function to undefined for noop & pubsub services * linter

view details

push time in 2 days

created tagphilnash/firebase-tools

tagv9.23.0

The Firebase Command Line Tools

created time in 2 days

push eventphilnash/firebase-tools

joehan

commit sha 4f1764c2b98e0f37fa8d6fb9c332484a01bc0157

Improved tracking on `firebase deploy` (#3899) * Improved tracking on `firebase deploy` * Update src/deploy/index.js Co-authored-by: Yuchen Shi <yuchenshi@google.com> Co-authored-by: Yuchen Shi <yuchenshi@google.com>

view details

joehan

commit sha 0048a1087db54f61e6d864fc2808d40aaba2010a

Adding support for project specific .env files (#3904)

view details

push time in 2 days

issue commentphilnash/twilio-video-screen-sharing

Screen Sharing Not Clear

Huh, good question. It looks like I started working on this and didn't actually get to the screen share part.

You could check out this repo instead or this blog post to see how to perform screen sharing with Twilio Video.

lcundiff

comment created time in 2 days

push eventphilnash/ngrok-for-vscode

snyk-bot

commit sha 8cabf886aeaa64b34b0ae481f20a5318ab3d8146

fix: package.json & package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-ANSIREGEX-1583908

view details

push time in 7 days

issue openedmdn/browser-compat-data

api.OTPCredential - missing browser support

<!-- Tips: where applicable, specify browser name, browser version, and mobile operating system version -->

What information was incorrect, unhelpful, or incomplete?

OTPCredential is supported in Chrome desktop since version 93.

What did you expect to see?

I expected the browser support matrix to show that Chrome desktop supported OTPCredential

Did you test this? If so, how?

I opened the Chrome browser tools and ran "OTPCredential" in window and it returned true. That was for my current version of Chrome (Version 96.0.4664.55 (Official Build) (x86_64) on macOS 12.0.1). To find historical data I found this announcement in the Chromium blog for support in Chrome 93.

<!-- Do not make changes below this line --> <details> <summary>MDN page report details</summary>

  • Query: api.OTPCredential
  • MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/OTPCredential
  • Report started: 2021-11-19T03:08:32.029Z

</details>

created time in 12 days

pull request commentbubenshchykov/ngrok

update uuid dependency version

Thanks for this.

Could you create the PR again without updating the ngrok binary though, please. Instructions for telling git to ignore it are here under Contributors in the readme: https://github.com/bubenshchykov/ngrok#contributors

BigZ

comment created time in 12 days

issue commentphilnash/twilio-video-react-hooks

Adding to a production Next.js web app

That's awesome, and a great use case for it! Glad it is working out!

rhtaylor

comment created time in 12 days

issue commentphilnash/twilio-video-react-hooks

Adding to a production Next.js web app

Did that work for you then?

And hey, you're the one building the application, that's the future I want to see created! If there's anything else I can do to help, let me know.

rhtaylor

comment created time in 13 days

issue commentphilnash/twilio-video-react-hooks

Adding to a production Next.js web app

I think the issue is within your controller action, which is currently:

def twilio 
  @token = Twilio::JWT::AccessToken.new(
    ENV['ACCOUNT_SID'],
    ENV['TWILIO_API_KEY_SID'],
    ENV['TWILIO_API_SECRET'],
    identity: identity
  )
  render json: @token
end

Firstly, you need to provide a video grant to this token so that it will grant access to the Video service. Next, you're returning the token object as a JSON object, but it needs to be converted to a token. Once it is a token, it is just a string, so wrap it in a hash so you can return it as JSON.

The documentation for generating a token for a Video room and a Ruby example is here.

Try changing your action to this:

def twilio 
  @token = Twilio::JWT::AccessToken.new(
    ENV['ACCOUNT_SID'],
    ENV['TWILIO_API_KEY_SID'],
    ENV['TWILIO_API_SECRET'],
    identity: identity
  )

  grant = Twilio::JWT::AccessToken::VideoGrant.new
  @token.add_grant(grant)

  render json: { token: @token.to_jwt }
end

Then, in your front-end you'll need to parse the response as JSON and then extract the token from the JSON object to use in Video.connect.

Let me know how you get on with that.

rhtaylor

comment created time in 13 days

issue commentphilnash/twilio-video-react-hooks

Adding to a production Next.js web app

Ah, ok, you have a Rails back-end for this. You need the entire token in the front-end to use it. Can you share how you are creating the token in the Rails app and how you are fetching it from the front-end? Also, where are you exceeding the max call stack, front or back end?

rhtaylor

comment created time in 13 days

Pull request review commentfirebase/firebase-tools

Corrects validation of secrets in extension installation

 async function promptReconfigureSecret(       } else {         secretName = await generateSecretName(projectId, instanceId, paramSpec.param);       }-       const secretValue = await promptOnce({         name: paramSpec.param,         type: "password",         message: `This secret will be stored in Cloud Secret Manager as ${secretName}.\nEnter new value for ${paramSpec.label.trim()}:`,       });-      if (!secret) {-        secret = await secretManagerApi.createSecret(-          projectId,-          secretName,-          secretsUtils.getSecretLabels(instanceId)-        );+      if (secretValue === "" && paramSpec.required) {+        logger.info(`Secret value cannot be empty for required param ${paramSpec.param}`);+        return promptReconfigureSecret(projectId, instanceId, paramSpec);+      } else if (secretValue !== "") {+        if (checkResponse(secretValue, paramSpec)) {+          if (!secret) {+            secret = await secretManagerApi.createSecret(+              projectId,+              secretName,+              secretsUtils.getSecretLabels(instanceId)+            );+          }+          return addNewSecretVersion(projectId, instanceId, secret, paramSpec, secretValue);+        } else {+          return promptReconfigureSecret(projectId, instanceId, paramSpec);+        }+      } else {+        return "";       }-      return addNewSecretVersion(projectId, instanceId, secret, paramSpec, secretValue);     case SecretUpdateAction.LEAVE:     default:-      return paramSpec.default || "";

Thanks! Updated.

philnash

comment created time in 13 days

PullRequestReviewEvent

push eventphilnash/firebase-tools

joehan

commit sha 0048a1087db54f61e6d864fc2808d40aaba2010a

Adding support for project specific .env files (#3904)

view details

Phil Nash

commit sha 226bd48dc5f995ccf8f625e2d2b8bc8ac89b6179

Merge branch 'master' into extensions-secret-validation

view details

push time in 13 days

push eventphilnash/firebase-tools

Phil Nash

commit sha d42874e45be4913a99c85e0e3554a03dcdafd24f

Return paramSpec.default when not reconfiguring an extension secret

view details

push time in 13 days

Pull request review commentfirebase/firebase-tools

Corrects validation of secrets in extension installation

 describe("askUserForParam", () => {       expect(res).to.equal("");     });   });-  describe("askForParam", () => {+  describe("askForParam with string param", () => {

This was to contrast with the new test below "askForParam with secret param".

philnash

comment created time in 13 days

PullRequestReviewEvent

issue commentphilnash/mediadevices-camera-selection

camera not off when disconnect video call

Hey, this is because in your disconnect event listener you refer to previewTracks but you never set previewTracks anywhere. So this conditional is false you don't try to stop any tracks:

                   if (previewTracks) {
                        previewTracks.forEach(function(track) {
                            track.stop();
                        });
                    }

Instead of previewTracks you should stop the local participant's tracks. Try this:

room.on('disconnected', function() {
  log('Left');

  room.localParticipant.tracks.forEach(function(trackPublication) {
    if (trackPublication.track) {
      trackPublication.track.stop();
    }
  });
  detachParticipantTracks(room.localParticipant);
  room.participants.forEach(detachParticipantTracks);
  activeRoom = null;
});
nitin-619

comment created time in 13 days

push eventphilnash/firebase-tools

joehan

commit sha 4f1764c2b98e0f37fa8d6fb9c332484a01bc0157

Improved tracking on `firebase deploy` (#3899) * Improved tracking on `firebase deploy` * Update src/deploy/index.js Co-authored-by: Yuchen Shi <yuchenshi@google.com> Co-authored-by: Yuchen Shi <yuchenshi@google.com>

view details

Phil Nash

commit sha b9e8fbc7ec4a62d52ea1a66cfdb0a4d2aa727489

Merge branch 'master' into extensions-secret-validation

view details

push time in 14 days

pull request commentfirebase/firebase-tools

Corrects validation of secrets in extension installation

@pavelgj I've updated this so that promptCreateSecret and promptReconfigureSecret handle the validation of the response within themselves, which simplifies askForParam. Both promptCreateSecret and promptReconfigureSecret both respond with the secret ID that is created (which I think would have broken things before).

My only question is what is supposed to happen when you are reconfiguring and you choose to leave a secret as it is? You don't seem to have access to the existing secret ID and returning an empty string feels wrong (though is what I have implemented for now).

philnash

comment created time in 14 days

push eventphilnash/firebase-tools

Phil Nash

commit sha 6665a918ccd7a9eae1e1e1cb139e865a5e01e48c

Simplifies askForParam and promptCreateSecret. With this change promptCreateSecret and promptReconfigureSecret both now handle their validation within their own functions. Once they return a string from within askForParam, that string will be valid. I do have questions over how reconfiguring a secret works when you choose to leave the value as is.

view details

push time in 14 days

issue commenttwilio-labs/twilio-firebase-extensions

Installation using Firebase console results in "Unknown error has occurred"

I have disabled validation for the secrets in the extensions. @TheAussieStew you should be able to install version 0.1.1 of the Send Message extension from the console now.

TheAussieStew

comment created time in 14 days

push eventtwilio-labs/twilio-firebase-extensions

Phil Nash

commit sha 2c26e4af29508b78fc841de84e8de632865696c5

Stops validating auth token/api key in extension.yml There is a bug in Firebase that gets the ID of the secret in secret manager and uses that as the secret value which fails the validation. This disables validating secrets while that is fixed.

view details

push time in 14 days

issue commenttwilio-labs/twilio-firebase-extensions

Installation using Firebase console results in "Unknown error has occurred"

Argh, I just tried this and found that the issue seems to be the same validation issue that the CLI is facing.

I will follow up with Firebase about this. Sorry!

TheAussieStew

comment created time in 14 days

issue commenttwilio-labs/twilio-firebase-extensions

Installation using Firebase console results in "Unknown error has occurred"

I have no idea what's going on here. Are you able to install other extensions at all?

The CLI may not help as that has other problems at the moment.

TheAussieStew

comment created time in 14 days

more