lens icon indicating copy to clipboard operation
lens copied to clipboard

extension protocol handler response is always lower case

Open farodin91 opened this issue 2 years ago • 3 comments

Describe the bug After upgrading from 5.5 to 6.0, my extension gets a lowered protocol routing.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'lens://extension/bla/bla/TEST/TEST'
  2. Wait for lens to be focus, see log.

Expected behavior Case should send correctly.

Environment (please complete the following information):

  • Lens Version: 6.0.1
  • OS: Linux
  • Installation method (e.g. snap or AppImage in Linux): rpm

Logs: When you run the application executable from command line you will see some logging output. Please paste them here:

info: [PROTOCOL ROUTER]: routing lens://extension/bla/bla/test/test

Additional context Add any other context about the problem here.

farodin91 avatar Aug 23 '22 12:08 farodin91

Do you have evidence that the values being provided to your extension are lowercased as well? I tried to reproduce both in unit tests (wasn't happening there) and manually testing on macOS and linux find that we don't lowercase them at all.

On linux I ran lens lens://app/FOOBAR from the command line and within lens the uppercase was still present.

So this sort of sounds like whatever is configured to run the through the opening (probably xdg-open) is lowercasing it.

Nokel81 avatar Aug 25 '22 14:08 Nokel81

We changed our logic. So, we don't need any more the protocol feature.

farodin91 avatar Sep 23 '22 17:09 farodin91

We have the same bad behavior in our lens extension in latest lens version. The extension has authorization and uses authorization code flow to retrieve token from identity provider. When external browser after successful authorization step redirects to lens via url (for example, lens:\\extension\<name of extension>\pathToHandler?code=AbC&state=DeF) the whole url converted to lowercase. Then app uses code from query string to retrieve token. Our identity provider supposes that code is bad because token validation case-sensitive and also signature check of the code failed.

I think, the problem related to these parts: https://github.com/lensapp/lens/blob/master/packages/core/src/main/start-main-application/runnables/show-initial-window.injectable.ts#L15 https://github.com/lensapp/lens/blob/master/packages/core/src/main/electron-app/runnables/setup-deep-linking.injectable.ts#L67

UPD: I forgot, we use Lens 6.4.0 for Windows

MikeBogolepov avatar Nov 01 '23 14:11 MikeBogolepov