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

feat: secret sharing #1886

Merged
merged 9 commits into from
May 29, 2024
Merged

feat: secret sharing #1886

merged 9 commits into from
May 29, 2024

Conversation

ShubhamPalriwala
Copy link
Contributor

Description 📣

Adds the ability to share secrets in a time-sensitive manner from the Infisical web dashboard with anybody (non-Infisical users as well) securely using a signing algorithm.

Loom Walkthrough

https://www.loom.com/share/cb54a37ae5724b5f85026425fe366e5a?sid=15e15f84-d447-4cf1-b5ef-90ac109c8621

Type ✨

  • New feature
  • Documentation

Tests 🛠️

  • Head over to any organisation's and project that you have access to
  • Visit the Secret Sharing tab from the left menu
  • On the Top Right, click on Add Secret & fill in the details
  • Now visit the URL you get after submitting the details in an incognito tab to access the secret
  • See that the secret gets expired after the time allowed by the creator both in the dashboard as well as the viewer

@ShubhamPalriwala ShubhamPalriwala force-pushed the shubham/feat-secret-sharing branch from 3dcbed5 to a93d350 Compare May 29, 2024 08:40
@ShubhamPalriwala ShubhamPalriwala force-pushed the shubham/feat-secret-sharing branch from a93d350 to 1068e60 Compare May 29, 2024 08:51
const { actor, actorId, orgId, actorAuthMethod, actorOrgId, name, encryptedValue, iv, tag, hashedHex, expiresAt } =
createSharedSecretInput;
const { permission } = await permissionService.getOrgPermission(actor, actorId, orgId, actorAuthMethod, actorOrgId);
if (!permission) throw new UnauthorizedError({ name: "User not in org" });
Copy link
Member

Choose a reason for hiding this comment

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

Just a suggestion: I think this is unneccessary as the getOrgPermission already does the check.

const [tableData, setTableData] = useState<TSharedSecret[]>([]);
const { isLoading, data = [] } = useGetSharedSecrets();

useEffect(() => {
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to do useEffect pattern for derived state.

You can just put it in variable like this

const filteredData = data.filter((secret) => !secret.expiresAt || new Date(secret.expiresAt) > new Date())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, thanks

@maidul98 maidul98 merged commit bbb21c9 into main May 29, 2024
5 of 6 checks passed
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.

3 participants