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

Gopass: Add Show Details Action #2286

Merged
merged 13 commits into from
Jul 19, 2022

Conversation

5mutawa
Copy link
Contributor

@5mutawa 5mutawa commented Jul 16, 2022

Description

Add “show details” action to display the secret contents

Displays the secrets content in a new view as pairs of key and value. Each content item has the action options of "Copy to Clipboard" or "Paste to Active App”.

Screencast

image

image

Checklist

@raycastbot raycastbot added the extension fix / improvement Label for PRs with extension's fix improvements label Jul 16, 2022
@raycastbot
Copy link
Collaborator

raycastbot commented Jul 16, 2022

Thank you for your contribution! 🎉

🔔 @bake you might want to have a look.

@bake
Copy link
Contributor

bake commented Jul 16, 2022

Hi @5mutawa, thank you for the addition!

I actually had a similar details view built previously but removed it before publishing. The problem when displaying information stored in gopass within Raycast is that the GPG key has to be already loaded. Someone might have set GPG Suite to not remember the key at all. When they try to open the details view, Pinetry Mac will open and close Raycast.

We could probably tell the users to set GPG Suite to remember the key for at least one minute, check if it is loaded and ask for the password within Raycast. Do you have an idea on how to implement something like this?

Another solution would be to ask @danielsequeira or @pernielsentikaer if it is possible to keep Raycast open when on a specific view.

@5mutawa
Copy link
Contributor Author

5mutawa commented Jul 16, 2022

@bake Yes good point, I have GPG set to not to remember the passphrase myself. When you click on Pinetry Mac it will close Raycast, but after you enter your key and reopen raycast it will be on the details view.

The current implementation in this PR works just fine for me. It would be nice to keep Raycast open while Pinetry Mac is in focus! Not sure of a way to achieve that just yet.

I doubt there is a secure way to ask for the GPG passphrase within Raycast. I will look into it and let you know.

Signed-off-by: Ian Mutawa <mma47@njit.edu>
{details.map((item, index) => {
const [key, value] = item.split(": ");
const copyAction = () => (index === 0 ? copyPassword(entry) : copy(key, value));
const pasteAction = () => (index === 0 ? pastePassword(entry) : paste(key, value));
Copy link
Contributor

@bake bake Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this would be more clear if you'd create the first List.Item manually outside the map? We could get rid of the concat in line 26 and these two actions. We also wouldn't have to compare to an index.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that first, but then I went in favor of fewer lines. I changed it to what you suggested, as I agree it's a better for readability.

import { copyPassword, pastePassword } from "./index";

async function copy(key: string, value: string): Promise<void> {
Clipboard.copy(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if it is important but you're using await on Clipboard.paste.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. I just forgot about it.


async function copyPassword(entry: string): Promise<void> {
export async function copyPassword(entry: string): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you already created a utils.ts, I think it would be a good fit for copyPassword and pastePassword. That would also clean up index.ts a little bit. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to have logic that performs a task to support other logic. In the case of copyPassword and pastePassword they are fully independent, I don't think they fit it utiles.ts

@bake
Copy link
Contributor

bake commented Jul 18, 2022

@5mutawa You're right, it works great. I'd be happy using it like this :)

@danielsequeira
Copy link
Contributor

@bake @5mutawa unfortunately to keep raycast window open while other apps are in focus

5mutawa added 3 commits July 18, 2022 11:28
Signed-off-by: Ian Mutawa <mma47@njit.edu>
Signed-off-by: Ian Mutawa <mma47@njit.edu>
Signed-off-by: Ian Mutawa <mma47@njit.edu>
)}

{details.map((item, index) => {
const [key, value] = item.split(": ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have several secrets containing : . What do you think of doing something like this?

const [key, ...values] = item.split(": ");
const value = values.join(": ");

Copy link
Contributor Author

@5mutawa 5mutawa Jul 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that looks great!

@bake
Copy link
Contributor

bake commented Jul 19, 2022

@5mutawa Thank you so much!

@danielsequeira danielsequeira merged commit 84b3055 into raycast:main Jul 19, 2022
@raycastbot
Copy link
Collaborator

Published to the Raycast Store:
https://raycast.com/bake/gopass

@5mutawa 5mutawa deleted the gopass/create-show-details-action branch July 19, 2022 14:25
colebemis added a commit to colebemis/raycast-extensions that referenced this pull request Apr 29, 2024
- Update raycast images
- Update raycast copy
- Merge branch \'contributions/merge-1714401066006496000\'
- Merge pull request raycast#2323 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- Add uncaughtException handler (raycast#2321)
- Don\'t throw an error if stitching doesn\'t see \`[DONE]\` (raycast#2320)
- Merge pull request raycast#2317 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- telemetry: record disk space avail/used at \`/\` (raycast#2313)
- Merge pull request raycast#2315 from githubnext/dsyme/bsl22
- update baselines
- Merge pull request raycast#2311 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- Merge pull request raycast#2312 from githubnext/fix-terminal-error
- Fix terminal error on narrow viewports
- Out of disk space: improve remove code (raycast#2305)
- Merge pull request raycast#2307 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- Make useLongerSpecs experiment private (raycast#2306)
- Bump redis to higher networking and size (raycast#2300)
- Merge pull request raycast#2301 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- Merge pull request raycast#2299 from githubnext/terminal-fix
- Adjust terminal z-index
- Merge pull request raycast#2296 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- approximate counting of tokens (raycast#2288)
- Fix layering (raycast#2294)
- Merge pull request raycast#2290 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- Merge pull request raycast#2289 from githubnext/drifkin/avoid-bad-deployment
- hardcode user IDs to avoid uk1 deployment
- Merge pull request raycast#2278 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- telemetry: use better instance IDs, add loadavg stats (raycast#2286)
- Merge pull request raycast#2282 from githubnext/more-guest-tweaks
- Two other tweaks for guest mode
- Merge pull request raycast#2280 from githubnext/fix-guest-mode
- Fix guest mode bugs
- add App Service-compatible SSH support (raycast#2274)
- Merge pull request raycast#2275 from githubnext/terkelg/2271
- Consistently use prod settings for staging (raycast#2268)
- fix and also prevent animation if layout is the same
- Merge pull request raycast#2267 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- telemetry: more resource stats and code fixes (raycast#2269)
- telemetry: report simple resource usage statistics every 30 seconds (raycast#2264)
- Merge pull request raycast#2261 from githubnext/integrate/staging-to-main
- Synchronize env vars between deployment slots for \`update\` (raycast#2263)
- Merge remote-tracking branch \'origin/staging\'
- Fix initial layout animation (raycast#2259)
- Merge pull request raycast#2250 from githubnext/integrate/staging-to-main
- Merge pull request raycast#2255 from githubnext/terkelg/hotfix
- Hide info button on empty timeline items (raycast#2256)
- Make file-tree and code scroll independently
- Fix FileExplorer (raycast#2241)
- Fix layout trigger raycast#2244 (raycast#2245)
- Allow editing branch name before PR creation (raycast#2247)
- fix playwright tests (raycast#2249)
- Merge pull request raycast#2238 from githubnext/integrate/main-to-staging
- Merge pull request raycast#2237 from githubnext/drifkin/stats-privileges
- only allow site devs to see stats info
- Merge pull request raycast#2236 from githubnext/integrate/staging-to-main
- Merge remote-tracking branch \'origin/staging\'
- Fix info button overlap (raycast#2234)
- Merge pull request raycast#2232 from githubnext/integrate/staging-to-main
- Use absolute URL for og image (raycast#2231)
- Merge pull request raycast#2227 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Last-minute polish 🕚💅 (raycast#2229)
- Add Open Graph image for social media sharing (raycast#2228)
- Merge pull request raycast#2225 from githubnext/info-tips
- add info about dashboards and exported dashboards (raycast#2226)
- Add copy for the spec/plan/implementation panel\'s info tips
- Merge pull request raycast#2219 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Update mobile previews (raycast#2223)
- Fix Monaco overlays + misc ✨  (raycast#2217)
- Merge pull request raycast#2215 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Better rate limit error message (raycast#2191)
- Create codespaces-faq.md (raycast#2189)
- Update playbook.md (raycast#2209)
- Make error for OAuth app restrictions more useful (raycast#2214)
- Merge pull request raycast#2204 from githubnext/integrate/main-to-staging
- Merge pull request raycast#2202 from githubnext/eaftan/feedback-link-update
- Merge pull request raycast#2203 from githubnext/dsyme/redeploy
- redeploy to different sku
- Use onClick instead of href
- Update \'Give feedback\' link to direct to user manual
- Merge pull request raycast#2200 from githubnext/integrate/production-to-staging
- tweak logging
- fix isSiteDev determination
- fix test failure
- Merge branch \'staging\' of https://github.com/githubnext/copilot-workspace into production
- make corrections
- Merge pull request raycast#2196 from githubnext/integrate/main-to-staging
- Merge pull request raycast#2194 from githubnext/integrate/staging-to-production
- Merge pull request raycast#2199 from githubnext/dsyme/af
- fix auth
- fix auth
- Merge remote-tracking branch \'origin/main\' into staging
- Merge pull request raycast#2195 from githubnext/colebemis/label-template-repos
- auth fix for guests
- Display label for template repositories on /new page
- Merge pull request raycast#2193 from githubnext/osortega/codespaces-auth-fix
- Merge branch \'main\' of https://github.com/githubnext/copilot-workspace into osortega/codespaces-auth-fix
- Merge remote-tracking branch \'origin/staging\' into production
- Merge pull request raycast#2187 from githubnext/integrate/main-to-staging
- File syncer fix
- Merge remote-tracking branch \'origin/main\' into staging
- Polish exit dialogs (raycast#2190)
- Add note about adding actors to the copilot_workspace_signup feature flag (raycast#2188)
- telemetry: record model call timing (raycast#2184)
- bump sizes of web app (raycast#2186)
- Merge pull request raycast#2182 from githubnext/osortega/message-update
- Merge pull request raycast#2181 from githubnext/integrate/staging-to-production
- Update error message regex
- Merge remote-tracking branch \'origin/staging\' into production
- Merge pull request raycast#2168 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Describe commit messages slightly differently to pull request descriptions (raycast#2180)
- Disable keyboard undo for now (raycast#2173)
- adds skeleton waitlist management workflow (raycast#2177)
- Merge pull request raycast#2164 from githubnext/integrate/staging-to-production
- Make file diffs scrollable while streaming (raycast#2170)
- Fix task description overflow (raycast#2171)
- telemetry: record endpoint and endpoint mode (completion or chat) (raycast#2169)
- Fix streaming of PR descriptions/commit messages in dialog (raycast#2159)
- Don\'t speculate on change of implementation (raycast#2161)
- telemetry: add stitch number to model call telemetry (raycast#2167)
- Ignore vim swapfiles in the file syncer (raycast#2162)
- Merge remote-tracking branch \'origin/staging\' into production
- Merge pull request raycast#2158 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Fix caching of model calls (raycast#2163)
- Add "Start Task" command to Raycase extension (raycast#2160)
- Limit session loading to 500 most recent sessions (raycast#2154)
- Add eslint config to raycast extension
- Update raycast readme
- Merge branch \'raycast-2\' of github.com:githubnext/semantic-workspace into raycast-2
- Fix lint issues
- Merge branch \'main\' into raycast-2
- Update default repo
- Add "Start Task" command to Raycase extension
- Merge pull request raycast#2149 from githubnext/integrate/staging-to-production
- Merge remote-tracking branch \'origin/staging\' into production
- Merge pull request raycast#2157 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Merge pull request raycast#2155 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Merge pull request raycast#2150 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Merge pull request raycast#2130 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Merge pull request raycast#2124 from githubnext/integrate/staging-to-production
- Merge pull request raycast#2128 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Merge pull request raycast#2122 from githubnext/integrate/main-to-staging
- Merge remote-tracking branch \'origin/main\' into staging
- Codespaces auth fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants