Skip to content

Commit

Permalink
Merge pull request #53 from harness/FFM-2684
Browse files Browse the repository at this point in the history
FFM-2684 Make target name same as identifier if it's not provided by the client
  • Loading branch information
jcox250 authored Mar 31, 2022
2 parents d9a4b7e + 58ee364 commit 9634e63
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions transport/encode_decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ func decodeAuthRequest(c echo.Context) (interface{}, error) {
if req.APIKey == "" {
return nil, fmt.Errorf("%w: apiKey cannot be empty", errBadRequest)
}

// Mimic what the client service does and set identifier value as the
// name if it hasn't been provided.
if req.Target.Name == "" {
req.Target.Name = req.Target.Identifier
}
return req, nil
}

Expand Down

0 comments on commit 9634e63

Please sign in to comment.