Skip to content

max_path_length value of 0 in PkiIssuerSignIntermediateRequest struct should not be omitted #261

Description

@adasiunas

Expected Behavior

When signing intermediate certificate with client.Secrets.PkiIssuerSignIntermediate function with request parameter as:

request := schema.PkiIssuerSignIntermediateRequest{
  ...
  MaxPathLength: 0,  
  ...
}

max_path_length property is omitted from the request body to the vault API, leading to generated certificate without pathlength property:

X509v3 Basic Constraints: critical
                CA:TRUE, pathlen:0 -> missing part 

This might be due to omitempty setting on MaxPathLength int32 json:"max_path_length,omitempty" property in PkiIssuerSignIntermediateRequest struct.

Current Behavior

I think MaxPathLength: 0 should not be omitted and certificate with pathlen:0 should be generated.

Failure Information

v0.4.3

Steps to Reproduce

Simply try to sign intermediate certificate, or build a variable with MaxPathLength = 0 of type PkiIssuerSignIntermediateRequest and json.Encode it. You will notice that json will not contain this value.

Additional Information

I think this property type should be a pointer (*int32). (Or omitempty removed completely).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions