Skip to content
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

Add support for custom browser launch templates #731

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

chrnorm
Copy link
Contributor

@chrnorm chrnorm commented Aug 12, 2024

What changed?

Adds the 'CUSTOM' browser key field and support for templating a browser launch command using the Go text/template library.

Removes the COMMON_FATE browser which referenced a custom desktop application we were testing last year which has since been deprecated.

Why?

Some Granted community members use browsers that we do not provide built-in support for in Granted, or wish to customise the behaviour of browser launching.

Examples:

This PR solves part of this customisation issue by allowing Granted users to specify their own browser launch template command:

# ~/.granted/config
[AWSConsoleBrowserLaunchTemplate]
Command = "/Applications/Firefox.app/Contents/MacOS/firefox --new-tab {{.URL}} --profile {{.Profile}} --some-flag {{.Args.Foo}}"
UseForkProcess = true

Additional arguments can be provided when calling assume or granted console, e.g.

assume -c --browser-launch-template-arg Foo=bar

This PR doesn't add custom browser support to our initial CLI onboarding. Given that this is an advanced feature we can initially add documentation for this to https://docs.commonfate.io, and then we can come back and add onboarding support for this in a future PR.

The Granted Containers Firefox extension uses a custom URL scheme to open a URL in a particular container.

You can construct this URL on MacOS using the following configuration:

# ~/.granted/config
[AWSConsoleBrowserLaunchTemplate]
Command = "/Applications/Firefox.app/Contents/MacOS/firefox --new-tab ext+granted-containers:name={{.Profile}}&url={{urlquery .URL}}"
UseForkProcess = true

For other operating systems, the executable path will be different but the flags will be the same.

How did you test it?

  • New custom launcher is covered with unit tests
  • Confirmed behaviour via a local dev build

Potential risks

Low risk as existing functionality remains the same

Is patch release candidate?

No, new feature

Link to relevant docs PRs

Adds the 'CUSTOM' browser key field and support for templating a browser launch command using the Go text/template library.
@JoshuaWilkes JoshuaWilkes merged commit 1cf495e into main Aug 15, 2024
3 checks passed
@JoshuaWilkes JoshuaWilkes deleted the custom-browser-launch-template branch August 15, 2024 07:22
@p5 p5 mentioned this pull request Aug 15, 2024
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 23, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [common-fate/granted](https://github.com/common-fate/granted) | minor | `v0.32.0` -> `v0.33.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>common-fate/granted (common-fate/granted)</summary>

### [`v0.33.0`](https://github.com/common-fate/granted/releases/tag/v0.33.0)

[Compare Source](common-fate/granted@v0.32.0...v0.33.0)

This release adds [support for XDG directories](common-fate/granted#726) (thankyou [@&#8203;chris3ware](https://github.com/chris3ware)!), and adds a new `granted request close` command for closing Just-In-Time Access Requests in Common Fate.

#### What's Changed

-   if we run into the issue with activation, print the diagnostics by [@&#8203;meyerjrr](https://github.com/meyerjrr) in common-fate/granted#734
-   Open the common fate console by [@&#8203;JoshuaWilkes](https://github.com/JoshuaWilkes) in common-fate/granted#732
-   Add support for custom browser launch templates by [@&#8203;chrnorm](https://github.com/chrnorm) in common-fate/granted#731
-   Add messaging when the proxy command cannot connect to the target in SSM by [@&#8203;JoshuaWilkes](https://github.com/JoshuaWilkes) in common-fate/granted#735
-   Add support for XDG directories by [@&#8203;chris3ware](https://github.com/chris3ware) in common-fate/granted#726
-   Add 'granted request close' subcommand by [@&#8203;ckluy31](https://github.com/ckluy31) in common-fate/granted#740
-   Fix success message when access request is closed by [@&#8203;ckluy31](https://github.com/ckluy31) in common-fate/granted#743
-   Fix nil pointer error in registry sync when merging fails with an unknown error by [@&#8203;JoshuaWilkes](https://github.com/JoshuaWilkes) in common-fate/granted#744
-   Granted login deprecation message should be clearer by [@&#8203;ckluy31](https://github.com/ckluy31) in common-fate/granted#745

#### New Contributors

-   [@&#8203;chris3ware](https://github.com/chris3ware) made their first contribution in common-fate/granted#726

**Full Changelog**: common-fate/granted@v0.32.0...v0.33.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants