Skip to content

Support for new generated_credentials type from Ops Manager #731

@praveenrewar

Description

@praveenrewar

Is your feature request related to a problem? Please describe.

Description: Problem Ops Manager recently introduced a new credential type called generated_credentials. Unlike existing credential types (which are strictly flat key-value pairs represented as map[string]string), the value field for generated_credentials can be an arbitrary JSON structure—including nested objects, arrays, or raw strings.

Because the om CLI strictly types Credential.Value as map[string]string in api/credentials_service.go, it fails to properly parse and display these new credentials.

Impact Users are unable to fetch or view generated_credentials using the om credentials command, which breaks automation workflows relying on these new credential types.

Describe the solution you'd like

  • Change the Credential.Value type from map[string]string to interface{} to support arbitrary JSON structures.
  • Update the PresentCredentials interface and implementations to handle interface{}.
  • Update the Table Presenter to dynamically handle nested maps (serializing non-string values to JSON strings) and non-map types (arrays, strings).
  • Update commands/credentials.go to safely type-assert map values when using the --credential-field flag.
  • Add comprehensive unit tests for the new generated_credentials structures.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions