Skip to content

Commit

Permalink
Make OidcTokenRequest a local struct
Browse files Browse the repository at this point in the history
  • Loading branch information
triarius committed Nov 10, 2022
1 parent bbd33c0 commit 8275e2c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions api/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import (

var ErrAudienceTooLong = errors.New("the API only supports at most one element in the audience")

type OidcTokenRequest struct {
Audience string `json:"audience"`
}

type OidcToken struct {
Token string `json:"token"`
}

func (c *Client) OidcToken(jobId string, audience ...string) (*OidcToken, *Response, error) {
var m *OidcTokenRequest
type oidcTokenRequest struct {
Audience string `json:"audience"`
}

var m *oidcTokenRequest
switch len(audience) {
case 0:
m = nil
case 1:
m = &OidcTokenRequest{Audience: audience[0]}
m = &oidcTokenRequest{Audience: audience[0]}
default:
return nil, nil, ErrAudienceTooLong
}
Expand Down

0 comments on commit 8275e2c

Please sign in to comment.