Rename roles.password to revealPassword - #553
Open
andrelandgraf wants to merge 2 commits into
Open
andrelandgraf wants to merge 2 commits into
andrelandgraf wants to merge 2 commits into
Conversation
…m resetPassword. password() read like a property and resetPassword handed back a Role whose password field was optional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
roles.password()reads like a property and is a network call.resetPasswordreturns aRolewhosepasswordfield is optional, so callers dig out the secret.Diagnosis
Two operations that exist to hand back a password returned different types, and one of the names hid that it does I/O.
Interface
Before:
After:
Both resolve to
string(or{ data, error }whenthrowOnErroris off). A reset response with a missing or empty password is a clientNeonError. Readiness polling still runs on the rawoperationsarray before that string is returned.postgres.roles.passwordis unpublished as a tool; the hidden selector is nowpostgres.roles.revealPassword. TheresetPasswordtool returns the string.Also in here
@neon/sdkand@neon/tools.Verification
pnpm --filter @neon/sdk test:ci— 146 passedpnpm --filter @neon/sdk test:types— 16 passedpnpm --filter @neon/sdk buildpnpm --filter @neon/tools test:ci— 140 passedFor your attention
roles.passwordis gone.resetPasswordis no longer aRole.roles.connectionStringhelper in this PR.