Skip to content

Secret Manager doesn't tell me which parameters are required #7794

Open

Description

@JustinBeckwith

Looking at this ol favorite:

const sm = new SecretManagerServiceClient();
const [secrets] = await sm.listSecrets({
  parent: 'projects/el-gato',
});

Looking at the listSecrets method, I see it takes an options bag. Great! I dig deeper:

listSecrets(request: protos.google.cloud.secretmanager.v1.IListSecretsRequest, options?: gax.CallOptions): Promise<[protos.google.cloud.secretmanager.v1.ISecret[], protos.google.cloud.secretmanager.v1.IListSecretsRequest | null, protos.google.cloud.secretmanager.v1.IListSecretsResponse]>;

Ok, fine, what does IListSecretsRequest look like:

/** Properties of a ListSecretsRequest. */
interface IListSecretsRequest {

    /** ListSecretsRequest parent */
    parent?: (string|null);

    /** ListSecretsRequest pageSize */
    pageSize?: (number|null);

    /** ListSecretsRequest pageToken */
    pageToken?: (string|null);
}

This has 2 separate problems:

  1. I have no idea which of these parameters are required. I know that when I ran my code without it, I got an exception for not passing a parent :)

  2. I have no idea what any of these properties mean (I mean I do, but a mortal wouldn't). Aren't there better descriptions somewhere for these properties in the protos?

Activity

  1. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Sep 2, 2020
  2. alexander-fenster commented on Sep 3, 2020

    @alexander-fenster
    Contributor

    This one is a valid bugreport / feature request. We do have comments in protos, but apparently protobuf.js ignores the //-style comments (it wants /* */-style comments). I even proposed the hacky way to fix it googleapis/gapic-generator-typescript#150 but we decided it must be fixed in protobuf.js.

    I think there might be an option for that, I'll try to figure out.

  3. alexander-fenster commented on Sep 3, 2020

    @alexander-fenster
    Contributor

    re: required fields - we mark required fields in protos (with annotations) but those annotations don't map well into the types generated by pbts. I need to think how to make it better.

  4. added
    🚨This issue needs some love.
    and removed
    🚨This issue needs some love.
    on Dec 2, 2020
  5. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    🚨This issue needs some love.
    on Mar 18, 2021
  6. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    library: google-cloud-node-coreIssues transferred from another repositorypriority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions