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

POC - Seed Secrets #2361

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from

Conversation

ShadowCat567
Copy link
Contributor

Problem

Issue number, if available:

Changes

Corresponding docs PR, if applicable:

Validation

Checklist

  • If this PR includes a functional change to the runtime behavior of the code, I have added or updated automated test coverage for this change.
  • If this PR requires a change to the Project Architecture README, I have included that update in this PR.
  • If this PR requires a docs update, I have linked to that docs PR above.
  • If this PR modifies E2E tests, makes changes to resource provisioning, or makes SDK calls, I have run the PR checks with the run-e2e label set.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

changeset-bot bot commented Dec 20, 2024

🦋 Changeset detected

Latest commit: cbaf469

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +7 to +8
//not using this anymore
//stole this from ../packages/cli/src/backend-identifier/local_namespace_resolver.ts for the POC
Copy link
Member

Choose a reason for hiding this comment

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

these will probably go to cli-core .

Comment on lines 7 to 8
// @public (undocumented)
export const GetSeedSecret: (secretName: string) => Promise<string>;
Copy link
Member

Choose a reason for hiding this comment

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

I'd just call it getSecret .

Other option we could consider is

type SeedSecretClient {
  getSecret: () => Promise<string>;
}

// factory returns implementation
getSeedSecretClient = () => SeedSecretClient

We should think about packaging of this because APIs to deal with secrets will grow over time.
We'll also have AuthSeedClient or so or set of auth related APIs. it would be good to group secrets and auth.

An alternative would be to develop namespaces:
@aws-amplify/backend-seed/secret and @aws-amplify/backend-seed/auth .

We should capture these alternatives in API review.

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 initially called it getSecret, but I got some errors since it conflicted with getSecret from the backend-secret package -- I'll probably experiment with it again

Copy link
Member

Choose a reason for hiding this comment

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

This might be helpful syntax to resolve that problem

import { authOutputSchema as authOutputSchemaV1 } from './v1.js';
.

or import * as backendSecret from 'backend-secret' and then backendSecret.getSecret .

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