Skip to content

Commit

Permalink
Update ente-auth extension (raycast#15354)
Browse files Browse the repository at this point in the history
* Update ente-auth extension

- Pull contributions
- linting
- choret: update readme
- chore: add keywords
- feat: add the ability to set preferred action
- add features to readme
- linting
- fix screenshots size
- add new screenshots
- add new constant
- separate logic into multiple commands
- linting
- add sorting system
- add emoji
- add hyperlink to notes field
- add action to open preferences
- import line break instead
- feat: paste totp instead of copy now
- linting
- feat: show secrets that are imported
- feat: delete export after use
- linting
- fix error handling
- more helper changes
- add more info for setup
- chore: changed the helper name
- feat: modularize
- Merge branch \'feat/add-extras\'
- Merge branch \'feat/add-imports\'
- update the readme
- linting
- remove useless import
- feat: add new screenshots
- feat: add extras to ui
- fix token generation
- chore: import constant
- fix: folder and file creation
- i hate react
- Merge pull request #1 from calebjonasson/main
- cleaning up project elsint and jest configurations
- feat: add imports
- add test file
- chore: removed useless comment
- fix: linting
- ran linting

* Update ente-auth extension

- chore: add changes
- Pull contributions
- linting
- choret: update readme
- chore: add keywords
- feat: add the ability to set preferred action
- add features to readme
- linting
- fix screenshots size
- add new screenshots
- add new constant
- separate logic into multiple commands
- linting
- add sorting system
- add emoji
- add hyperlink to notes field
- add action to open preferences
- import line break instead
- feat: paste totp instead of copy now
- linting
- feat: show secrets that are imported
- feat: delete export after use
- linting
- fix error handling
- more helper changes
- add more info for setup
- chore: changed the helper name
- feat: modularize
- Merge branch \'feat/add-extras\'
- Merge branch \'feat/add-imports\'
- update the readme
- linting
- remove useless import
- feat: add new screenshots
- feat: add extras to ui
- fix token generation
- chore: import constant
- fix: folder and file creation
- i hate react
- Merge pull request #1 from calebjonasson/main
- cleaning up project elsint and jest configurations
- feat: add imports
- add test file
- chore: removed useless comment
- fix: linting
- ran linting

* Update ente-auth extension

- fix: reintroduce pr-15036 from albarin
- chore: add changes
- Pull contributions
- linting
- choret: update readme
- chore: add keywords
- feat: add the ability to set preferred action
- add features to readme
- linting
- fix screenshots size
- add new screenshots
- add new constant
- separate logic into multiple commands
- linting
- add sorting system
- add emoji
- add hyperlink to notes field
- add action to open preferences
- import line break instead
- feat: paste totp instead of copy now
- linting
- feat: show secrets that are imported
- feat: delete export after use
- linting
- fix error handling
- more helper changes
- add more info for setup
- chore: changed the helper name
- feat: modularize
- Merge branch \'feat/add-extras\'
- Merge branch \'feat/add-imports\'
- update the readme
- linting
- remove useless import
- feat: add new screenshots
- feat: add extras to ui
- fix token generation
- chore: import constant
- fix: folder and file creation
- i hate react
- Merge pull request #1 from calebjonasson/main
- cleaning up project elsint and jest configurations
- feat: add imports
- add test file
- chore: removed useless comment
- fix: linting
- ran linting

* Update CHANGELOG.md and optimise images

---------

Co-authored-by: raycastbot <[email protected]>
  • Loading branch information
chkpwd and raycastbot authored Nov 14, 2024
1 parent f27b978 commit e964c07
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 16 deletions.
9 changes: 8 additions & 1 deletion extensions/ente-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Ente Auth Changelog

## [Bug fix] - 2024-11-13
- Added PR-15036 changes contributed by albarin

## [New Additions] - 2024-11-13

- Add the ability to change preferred actions; e.g. (paste or copy on enter)

## [Bug fix] - 2024-08-28
- Fix error in `Get TOPT` command when secrets are empty

## [Initial Version] - 2024-08-28
## [Initial Version] - 2024-08-28
15 changes: 13 additions & 2 deletions extensions/ente-auth/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# A Raycast extension that uses your Ente Auth exports

## Features

- Imports: Ability to dynamically import secrets
- TOTP Code Display: Fetches and displays TOTP secrets exported from Ente Auth.
- Sorted Data: Most used TOTP codes will be displayed at the top. Use ⌘ + [Number] to select.
Expand All @@ -12,7 +13,6 @@

## Usage

> [!NOTE]
> The Ente Auth [CLI](https://github.com/ente-io/ente/tree/main/cli) is required.
## Setup
Expand All @@ -21,14 +21,25 @@ As explained [here](https://github.com/ente-io/ente/tree/main/cli#accounts), run
`ente account add` to login into an existing account. If you wish to update your account information, run the below:
```ente account update --app auth --email <email> --dir <path>```.

#### Adding your account

As explained [here](https://github.com/ente-io/ente/tree/main/cli#accounts), run:
`ente account add` to login into an existing account.
If you wish to update your account information, run the below:
`ente account update --app auth --email <email> --dir <path>`.

## Next Steps

#### Using Raycast

- Run `Export Secrets`. This will create a `~/Documents/ente` directory and a file named `ente_auth.txt`.
- Run `Import Secrets`. This will import all serialized items into Raycast encrypted database.

#### Using Ente
To perform a manual import, run: ```ente export```, then run `Import Secrets`.

To perform a manual import, run: `ente export`, then run `Import Secrets`.
Or perform the same actions but through the UI as long as the file is placed in the `~/Documents/ente` folder.

## Optionally

You can delete exported secrets from it's exported path by using `Delete Export`.
28 changes: 28 additions & 0 deletions extensions/ente-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
"categories": [
"Security"
],
"keywords": [
"ente",
"totp",
"2fa",
"security",
"authentication",
"otp",
"mfa",
"authenticator"
],
"license": "MIT",
"commands": [
{
Expand Down Expand Up @@ -54,6 +64,24 @@
"title": "Ente CLI Export Location",
"description": "If you wish to change the default export path, type here the location of your local installation.",
"placeholder": "Export Path"
},
{
"name": "action",
"type": "dropdown",
"title": "Primary Action",
"description": "Choose whether the primary action should copy or paste the output.",
"data": [
{
"title": "Copy",
"value": "copy"
},
{
"title": "Paste",
"value": "paste"
}
],
"default": "paste",
"required": false
}
],
"dependencies": {
Expand Down
34 changes: 21 additions & 13 deletions extensions/ente-auth/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { JsonFormat } from "./helpers/types";
import { getJsonFormatFromStore } from "./helpers";
import { useFrecencySorting } from "@raycast/utils";
import { getProgressIcon, getFavicon } from "@raycast/utils";
import { ActionPanel, Action, List, Icon } from "@raycast/api";
import { ActionPanel, Action, List, Icon, getPreferenceValues } from "@raycast/api";

// Ente colors - purple #A400B6, orange #FF9800
const getProgressColor = (remainingTime: number) => {
Expand Down Expand Up @@ -49,9 +49,28 @@ export default function Command() {
const Label = Metadata.Label;
const Separator = Metadata.Separator;

const PreferredAction = getPreferenceValues().action;

return (
<List navigationTitle="Get TOTP" searchBarPlaceholder="Search..." isShowingDetail>
{secrets.map((item, index) => {
const userActions = [
<Action.CopyToClipboard
key="copy"
title="Copy Current"
icon={Icon.Key}
content={item.current_totp}
onCopy={() => visitItem(item)}
/>,
<Action.Paste
key="paste"
title="Paste Current"
icon={Icon.Key}
content={item.current_totp}
onPaste={() => visitItem(item)}
/>,
];

return (
<List.Item
key={index}
Expand Down Expand Up @@ -96,18 +115,7 @@ export default function Command() {
actions={
<ActionPanel>
<ActionPanel.Section title="Current">
<Action.Paste
title="Paste TOTP"
icon={Icon.Clipboard}
content={item.current_totp}
onPaste={() => visitItem(item)}
/>
<Action.CopyToClipboard
title="Copy Current"
icon={Icon.Key}
content={item.current_totp}
onCopy={() => visitItem(item)}
/>
{PreferredAction === "copy" ? userActions : userActions.toReversed()}
</ActionPanel.Section>
<ActionPanel.Section title="Next">
<Action.CopyToClipboard
Expand Down

0 comments on commit e964c07

Please sign in to comment.