diff --git a/pkg/server/api/admin/admin.gen.go b/pkg/server/api/admin/admin.gen.go index af3ba7c7..518d8bd7 100644 --- a/pkg/server/api/admin/admin.gen.go +++ b/pkg/server/api/admin/admin.gen.go @@ -154,6 +154,9 @@ type ClientInterface interface { // GetRelationshipByID request GetRelationshipByID(ctx context.Context, relationshipID externalRef0.UUID, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetJoinToken request + GetJoinToken(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListTrustDomains request ListTrustDomains(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -172,9 +175,6 @@ type ClientInterface interface { PutTrustDomainByNameWithBody(ctx context.Context, trustDomainName externalRef0.TrustDomainName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PutTrustDomainByName(ctx context.Context, trustDomainName externalRef0.TrustDomainName, body PutTrustDomainByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - - // GetJoinToken request - GetJoinToken(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*http.Response, error) } func (c *Client) GetRelationships(ctx context.Context, params *GetRelationshipsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -225,6 +225,18 @@ func (c *Client) GetRelationshipByID(ctx context.Context, relationshipID externa return c.Client.Do(req) } +func (c *Client) GetJoinToken(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetJoinTokenRequest(c.Server, trustDomainName, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListTrustDomains(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListTrustDomainsRequest(c.Server) if err != nil { @@ -309,18 +321,6 @@ func (c *Client) PutTrustDomainByName(ctx context.Context, trustDomainName exter return c.Client.Do(req) } -func (c *Client) GetJoinToken(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewGetJoinTokenRequest(c.Server, trustDomainName, params) - if err != nil { - return nil, err - } - req = req.WithContext(ctx) - if err := c.applyEditors(ctx, req, reqEditors); err != nil { - return nil, err - } - return c.Client.Do(req) -} - // NewGetRelationshipsRequest generates requests for GetRelationships func NewGetRelationshipsRequest(server string, params *GetRelationshipsParams) (*http.Request, error) { var err error @@ -492,6 +492,58 @@ func NewGetRelationshipByIDRequest(server string, relationshipID externalRef0.UU return req, nil } +// NewGetJoinTokenRequest generates requests for GetJoinToken +func NewGetJoinTokenRequest(server string, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "trustDomainName", runtime.ParamLocationPath, trustDomainName) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/trust-domain/%s/join-token", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ttl", runtime.ParamLocationQuery, params.Ttl); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + // NewListTrustDomainsRequest generates requests for ListTrustDomains func NewListTrustDomainsRequest(server string) (*http.Request, error) { var err error @@ -501,7 +553,7 @@ func NewListTrustDomainsRequest(server string) (*http.Request, error) { return nil, err } - operationPath := fmt.Sprintf("/trust-domain") + operationPath := fmt.Sprintf("/trust-domains") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -539,7 +591,7 @@ func NewPutTrustDomainRequestWithBody(server string, contentType string, body io return nil, err } - operationPath := fmt.Sprintf("/trust-domain") + operationPath := fmt.Sprintf("/trust-domains") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -575,7 +627,7 @@ func NewDeleteTrustDomainByNameRequest(server string, trustDomainName externalRe return nil, err } - operationPath := fmt.Sprintf("/trust-domain/%s", pathParam0) + operationPath := fmt.Sprintf("/trust-domains/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -609,7 +661,7 @@ func NewGetTrustDomainByNameRequest(server string, trustDomainName externalRef0. return nil, err } - operationPath := fmt.Sprintf("/trust-domain/%s", pathParam0) + operationPath := fmt.Sprintf("/trust-domains/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -654,7 +706,7 @@ func NewPutTrustDomainByNameRequestWithBody(server string, trustDomainName exter return nil, err } - operationPath := fmt.Sprintf("/trust-domain/%s", pathParam0) + operationPath := fmt.Sprintf("/trust-domains/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -674,58 +726,6 @@ func NewPutTrustDomainByNameRequestWithBody(server string, trustDomainName exter return req, nil } -// NewGetJoinTokenRequest generates requests for GetJoinToken -func NewGetJoinTokenRequest(server string, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "trustDomainName", runtime.ParamLocationPath, trustDomainName) - if err != nil { - return nil, err - } - - serverURL, err := url.Parse(server) - if err != nil { - return nil, err - } - - operationPath := fmt.Sprintf("/trust-domain/%s/join-token", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath - } - - queryURL, err := serverURL.Parse(operationPath) - if err != nil { - return nil, err - } - - if params != nil { - queryValues := queryURL.Query() - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ttl", runtime.ParamLocationQuery, params.Ttl); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - queryURL.RawQuery = queryValues.Encode() - } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } - - return req, nil -} - func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { for _, r := range c.RequestEditors { if err := r(ctx, req); err != nil { @@ -780,6 +780,9 @@ type ClientWithResponsesInterface interface { // GetRelationshipByID request GetRelationshipByIDWithResponse(ctx context.Context, relationshipID externalRef0.UUID, reqEditors ...RequestEditorFn) (*GetRelationshipByIDResponse, error) + // GetJoinToken request + GetJoinTokenWithResponse(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*GetJoinTokenResponse, error) + // ListTrustDomains request ListTrustDomainsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTrustDomainsResponse, error) @@ -798,9 +801,6 @@ type ClientWithResponsesInterface interface { PutTrustDomainByNameWithBodyWithResponse(ctx context.Context, trustDomainName externalRef0.TrustDomainName, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutTrustDomainByNameResponse, error) PutTrustDomainByNameWithResponse(ctx context.Context, trustDomainName externalRef0.TrustDomainName, body PutTrustDomainByNameJSONRequestBody, reqEditors ...RequestEditorFn) (*PutTrustDomainByNameResponse, error) - - // GetJoinToken request - GetJoinTokenWithResponse(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*GetJoinTokenResponse, error) } type GetRelationshipsResponse struct { @@ -872,15 +872,15 @@ func (r GetRelationshipByIDResponse) StatusCode() int { return 0 } -type ListTrustDomainsResponse struct { +type GetJoinTokenResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *externalRef0.TrustDomain + JSON200 *JoinTokenResponse JSONDefault *externalRef0.ApiError } // Status returns HTTPResponse.Status -func (r ListTrustDomainsResponse) Status() string { +func (r GetJoinTokenResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -888,22 +888,22 @@ func (r ListTrustDomainsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListTrustDomainsResponse) StatusCode() int { +func (r GetJoinTokenResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PutTrustDomainResponse struct { +type ListTrustDomainsResponse struct { Body []byte HTTPResponse *http.Response - JSON201 *externalRef0.TrustDomain + JSON200 *externalRef0.TrustDomain JSONDefault *externalRef0.ApiError } // Status returns HTTPResponse.Status -func (r PutTrustDomainResponse) Status() string { +func (r ListTrustDomainsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -911,21 +911,22 @@ func (r PutTrustDomainResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PutTrustDomainResponse) StatusCode() int { +func (r ListTrustDomainsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteTrustDomainByNameResponse struct { +type PutTrustDomainResponse struct { Body []byte HTTPResponse *http.Response + JSON201 *externalRef0.TrustDomain JSONDefault *externalRef0.ApiError } // Status returns HTTPResponse.Status -func (r DeleteTrustDomainByNameResponse) Status() string { +func (r PutTrustDomainResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -933,22 +934,21 @@ func (r DeleteTrustDomainByNameResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteTrustDomainByNameResponse) StatusCode() int { +func (r PutTrustDomainResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetTrustDomainByNameResponse struct { +type DeleteTrustDomainByNameResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *externalRef0.TrustDomain JSONDefault *externalRef0.ApiError } // Status returns HTTPResponse.Status -func (r GetTrustDomainByNameResponse) Status() string { +func (r DeleteTrustDomainByNameResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -956,14 +956,14 @@ func (r GetTrustDomainByNameResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetTrustDomainByNameResponse) StatusCode() int { +func (r DeleteTrustDomainByNameResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type PutTrustDomainByNameResponse struct { +type GetTrustDomainByNameResponse struct { Body []byte HTTPResponse *http.Response JSON200 *externalRef0.TrustDomain @@ -971,7 +971,7 @@ type PutTrustDomainByNameResponse struct { } // Status returns HTTPResponse.Status -func (r PutTrustDomainByNameResponse) Status() string { +func (r GetTrustDomainByNameResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -979,22 +979,22 @@ func (r PutTrustDomainByNameResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r PutTrustDomainByNameResponse) StatusCode() int { +func (r GetTrustDomainByNameResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetJoinTokenResponse struct { +type PutTrustDomainByNameResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *JoinTokenResponse + JSON200 *externalRef0.TrustDomain JSONDefault *externalRef0.ApiError } // Status returns HTTPResponse.Status -func (r GetJoinTokenResponse) Status() string { +func (r PutTrustDomainByNameResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -1002,7 +1002,7 @@ func (r GetJoinTokenResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetJoinTokenResponse) StatusCode() int { +func (r PutTrustDomainByNameResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } @@ -1044,6 +1044,15 @@ func (c *ClientWithResponses) GetRelationshipByIDWithResponse(ctx context.Contex return ParseGetRelationshipByIDResponse(rsp) } +// GetJoinTokenWithResponse request returning *GetJoinTokenResponse +func (c *ClientWithResponses) GetJoinTokenWithResponse(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*GetJoinTokenResponse, error) { + rsp, err := c.GetJoinToken(ctx, trustDomainName, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetJoinTokenResponse(rsp) +} + // ListTrustDomainsWithResponse request returning *ListTrustDomainsResponse func (c *ClientWithResponses) ListTrustDomainsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListTrustDomainsResponse, error) { rsp, err := c.ListTrustDomains(ctx, reqEditors...) @@ -1105,15 +1114,6 @@ func (c *ClientWithResponses) PutTrustDomainByNameWithResponse(ctx context.Conte return ParsePutTrustDomainByNameResponse(rsp) } -// GetJoinTokenWithResponse request returning *GetJoinTokenResponse -func (c *ClientWithResponses) GetJoinTokenWithResponse(ctx context.Context, trustDomainName externalRef0.TrustDomainName, params *GetJoinTokenParams, reqEditors ...RequestEditorFn) (*GetJoinTokenResponse, error) { - rsp, err := c.GetJoinToken(ctx, trustDomainName, params, reqEditors...) - if err != nil { - return nil, err - } - return ParseGetJoinTokenResponse(rsp) -} - // ParseGetRelationshipsResponse parses an HTTP response from a GetRelationshipsWithResponse call func ParseGetRelationshipsResponse(rsp *http.Response) (*GetRelationshipsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) @@ -1213,22 +1213,22 @@ func ParseGetRelationshipByIDResponse(rsp *http.Response) (*GetRelationshipByIDR return response, nil } -// ParseListTrustDomainsResponse parses an HTTP response from a ListTrustDomainsWithResponse call -func ParseListTrustDomainsResponse(rsp *http.Response) (*ListTrustDomainsResponse, error) { +// ParseGetJoinTokenResponse parses an HTTP response from a GetJoinTokenWithResponse call +func ParseGetJoinTokenResponse(rsp *http.Response) (*GetJoinTokenResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListTrustDomainsResponse{ + response := &GetJoinTokenResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest externalRef0.TrustDomain + var dest JoinTokenResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1246,26 +1246,26 @@ func ParseListTrustDomainsResponse(rsp *http.Response) (*ListTrustDomainsRespons return response, nil } -// ParsePutTrustDomainResponse parses an HTTP response from a PutTrustDomainWithResponse call -func ParsePutTrustDomainResponse(rsp *http.Response) (*PutTrustDomainResponse, error) { +// ParseListTrustDomainsResponse parses an HTTP response from a ListTrustDomainsWithResponse call +func ParseListTrustDomainsResponse(rsp *http.Response) (*ListTrustDomainsResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PutTrustDomainResponse{ + response := &ListTrustDomainsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: var dest externalRef0.TrustDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON201 = &dest + response.JSON200 = &dest case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest externalRef0.ApiError @@ -1279,20 +1279,27 @@ func ParsePutTrustDomainResponse(rsp *http.Response) (*PutTrustDomainResponse, e return response, nil } -// ParseDeleteTrustDomainByNameResponse parses an HTTP response from a DeleteTrustDomainByNameWithResponse call -func ParseDeleteTrustDomainByNameResponse(rsp *http.Response) (*DeleteTrustDomainByNameResponse, error) { +// ParsePutTrustDomainResponse parses an HTTP response from a PutTrustDomainWithResponse call +func ParsePutTrustDomainResponse(rsp *http.Response) (*PutTrustDomainResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteTrustDomainByNameResponse{ + response := &PutTrustDomainResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201: + var dest externalRef0.TrustDomain + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON201 = &dest + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest externalRef0.ApiError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -1305,27 +1312,20 @@ func ParseDeleteTrustDomainByNameResponse(rsp *http.Response) (*DeleteTrustDomai return response, nil } -// ParseGetTrustDomainByNameResponse parses an HTTP response from a GetTrustDomainByNameWithResponse call -func ParseGetTrustDomainByNameResponse(rsp *http.Response) (*GetTrustDomainByNameResponse, error) { +// ParseDeleteTrustDomainByNameResponse parses an HTTP response from a DeleteTrustDomainByNameWithResponse call +func ParseDeleteTrustDomainByNameResponse(rsp *http.Response) (*DeleteTrustDomainByNameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetTrustDomainByNameResponse{ + response := &DeleteTrustDomainByNameResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest externalRef0.TrustDomain - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && true: var dest externalRef0.ApiError if err := json.Unmarshal(bodyBytes, &dest); err != nil { @@ -1338,15 +1338,15 @@ func ParseGetTrustDomainByNameResponse(rsp *http.Response) (*GetTrustDomainByNam return response, nil } -// ParsePutTrustDomainByNameResponse parses an HTTP response from a PutTrustDomainByNameWithResponse call -func ParsePutTrustDomainByNameResponse(rsp *http.Response) (*PutTrustDomainByNameResponse, error) { +// ParseGetTrustDomainByNameResponse parses an HTTP response from a GetTrustDomainByNameWithResponse call +func ParseGetTrustDomainByNameResponse(rsp *http.Response) (*GetTrustDomainByNameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &PutTrustDomainByNameResponse{ + response := &GetTrustDomainByNameResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -1371,22 +1371,22 @@ func ParsePutTrustDomainByNameResponse(rsp *http.Response) (*PutTrustDomainByNam return response, nil } -// ParseGetJoinTokenResponse parses an HTTP response from a GetJoinTokenWithResponse call -func ParseGetJoinTokenResponse(rsp *http.Response) (*GetJoinTokenResponse, error) { +// ParsePutTrustDomainByNameResponse parses an HTTP response from a PutTrustDomainByNameWithResponse call +func ParsePutTrustDomainByNameResponse(rsp *http.Response) (*PutTrustDomainByNameResponse, error) { bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetJoinTokenResponse{ + response := &PutTrustDomainByNameResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest JoinTokenResponse + var dest externalRef0.TrustDomain if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -1415,24 +1415,24 @@ type ServerInterface interface { // Get a specific relationship // (GET /relationships/{relationshipID}) GetRelationshipByID(ctx echo.Context, relationshipID externalRef0.UUID) error + // Get a join token for a specific Trust Domain + // (GET /trust-domain/{trustDomainName}/join-token) + GetJoinToken(ctx echo.Context, trustDomainName externalRef0.TrustDomainName, params GetJoinTokenParams) error // List all trust domains - // (GET /trust-domain) + // (GET /trust-domains) ListTrustDomains(ctx echo.Context) error // Add a specific trust domain - // (PUT /trust-domain) + // (PUT /trust-domains) PutTrustDomain(ctx echo.Context) error // Deletes a specific trust domain - // (DELETE /trust-domain/{trustDomainName}) + // (DELETE /trust-domains/{trustDomainName}) DeleteTrustDomainByName(ctx echo.Context, trustDomainName externalRef0.TrustDomainName) error // Get a specific trust domain - // (GET /trust-domain/{trustDomainName}) + // (GET /trust-domains/{trustDomainName}) GetTrustDomainByName(ctx echo.Context, trustDomainName externalRef0.TrustDomainName) error // Update a specific trust domain - // (PUT /trust-domain/{trustDomainName}) + // (PUT /trust-domains/{trustDomainName}) PutTrustDomainByName(ctx echo.Context, trustDomainName externalRef0.TrustDomainName) error - // Get a join token for a specific Trust Domain - // (GET /trust-domain/{trustDomainName}/join-token) - GetJoinToken(ctx echo.Context, trustDomainName externalRef0.TrustDomainName, params GetJoinTokenParams) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -1504,6 +1504,31 @@ func (w *ServerInterfaceWrapper) GetRelationshipByID(ctx echo.Context) error { return err } +// GetJoinToken converts echo context to params. +func (w *ServerInterfaceWrapper) GetJoinToken(ctx echo.Context) error { + var err error + // ------------- Path parameter "trustDomainName" ------------- + var trustDomainName externalRef0.TrustDomainName + + err = runtime.BindStyledParameterWithLocation("simple", false, "trustDomainName", runtime.ParamLocationPath, ctx.Param("trustDomainName"), &trustDomainName) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter trustDomainName: %s", err)) + } + + // Parameter object where we will unmarshal all parameters from the context + var params GetJoinTokenParams + // ------------- Required query parameter "ttl" ------------- + + err = runtime.BindQueryParameter("form", true, true, "ttl", ctx.QueryParams(), ¶ms.Ttl) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ttl: %s", err)) + } + + // Invoke the callback with all the unmarshalled arguments + err = w.Handler.GetJoinToken(ctx, trustDomainName, params) + return err +} + // ListTrustDomains converts echo context to params. func (w *ServerInterfaceWrapper) ListTrustDomains(ctx echo.Context) error { var err error @@ -1570,31 +1595,6 @@ func (w *ServerInterfaceWrapper) PutTrustDomainByName(ctx echo.Context) error { return err } -// GetJoinToken converts echo context to params. -func (w *ServerInterfaceWrapper) GetJoinToken(ctx echo.Context) error { - var err error - // ------------- Path parameter "trustDomainName" ------------- - var trustDomainName externalRef0.TrustDomainName - - err = runtime.BindStyledParameterWithLocation("simple", false, "trustDomainName", runtime.ParamLocationPath, ctx.Param("trustDomainName"), &trustDomainName) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter trustDomainName: %s", err)) - } - - // Parameter object where we will unmarshal all parameters from the context - var params GetJoinTokenParams - // ------------- Required query parameter "ttl" ------------- - - err = runtime.BindQueryParameter("form", true, true, "ttl", ctx.QueryParams(), ¶ms.Ttl) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ttl: %s", err)) - } - - // Invoke the callback with all the unmarshalled arguments - err = w.Handler.GetJoinToken(ctx, trustDomainName, params) - return err -} - // This is a simple interface which specifies echo.Route addition functions which // are present on both echo.Echo and echo.Group, since we want to allow using // either of them for path registration @@ -1626,53 +1626,54 @@ func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL router.GET(baseURL+"/relationships", wrapper.GetRelationships) router.PUT(baseURL+"/relationships", wrapper.PutRelationship) router.GET(baseURL+"/relationships/:relationshipID", wrapper.GetRelationshipByID) - router.GET(baseURL+"/trust-domain", wrapper.ListTrustDomains) - router.PUT(baseURL+"/trust-domain", wrapper.PutTrustDomain) - router.DELETE(baseURL+"/trust-domain/:trustDomainName", wrapper.DeleteTrustDomainByName) - router.GET(baseURL+"/trust-domain/:trustDomainName", wrapper.GetTrustDomainByName) - router.PUT(baseURL+"/trust-domain/:trustDomainName", wrapper.PutTrustDomainByName) router.GET(baseURL+"/trust-domain/:trustDomainName/join-token", wrapper.GetJoinToken) + router.GET(baseURL+"/trust-domains", wrapper.ListTrustDomains) + router.PUT(baseURL+"/trust-domains", wrapper.PutTrustDomain) + router.DELETE(baseURL+"/trust-domains/:trustDomainName", wrapper.DeleteTrustDomainByName) + router.GET(baseURL+"/trust-domains/:trustDomainName", wrapper.GetTrustDomainByName) + router.PUT(baseURL+"/trust-domains/:trustDomainName", wrapper.PutTrustDomainByName) } // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ - "H4sIAAAAAAAC/9xZbXPauBb+Kxrd/bC7Y7CBQBNm9gMJJKVNaBLotk2Tywj72CixLUeSISTj/35HskNs", - "MHnbtLt7PyEsS+flec7R0fEdtlkQsRBCKXD7DnMQEQsF6D9dcEnsSzW0WSgh1EMSRT61iaQsNC8FC9Uz", - "YU8hIGr0CwcXt/F/zId9zXRWmJ2I9jhnHCdJYmAHhM1ppPbBbawnUOe4jx5UUG9la9XWy+VKCcehaiXx", - "jzmLgEuqVHaJL8DAUe6RUt0B9esyHhCJ25iGsrWFDRyQGxrEAW43d3YMHNAw/VezLAPLRQTpq+ABx4mB", - "AxCCeHonuCFB5Kv5DpoAiSV1Yx+BtuD+NeNBnpCchl4q8BBCT05xu54Tks0razlcx5SDg9vfU70f5F4s", - "32eTS7Cl0mlP+SmUQ0lkrG2FUFnwXWHE2QwcrNwcUj2IIHSUnIs1wQb+wGg4YlcQFs1ruGS76ba2Ks13", - "tXeVrWarXpk0XLtSt3daDbfVIi5p5S2NY+oU7Wy0DBwRKYErkP/73arskIp7cbedVJbjrWeMa/XkF/yY", - "4qcZa15IDnlv9GO8ffDOKkbp8jJojokHgziYgKZrkeujKaBQzyHmIiohEEgyJK5ohCbgMg5ISMIlDT31", - "3Ga+D7ZEcgoqOGJfIgGyinOcLWWsUmFIbyFVIAvlumVs1EYU1OEgYx5WC4Fi5eOkVGYsT8HXyUFMaXQK", - "1zEI+VJQeCzk2GEBoeGYjEMSwFMQjdSSrl4xUK8nRnGXyet2WYW7RLFyQaWUiGVOwOtcU4AuH6p6Z5Qq", - "geSUSMQh4qDSgyYOhJLKBfr6msRk4Ldw3ka/5Anz0tzOgUhwxkQWvVG36rWKVas0rJG13W5Ybcs6y1vu", - "EAkVSTV8eeNrJbZT5ynLP3/ud9cYR8Z2mp2fWl1M4uvbvFr+28TNm1gxea0Vk9daEUfOD2bGCr31yZf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rdj+V9IBhWy", + "ZF6ac5R4BnCd6EtpF3y/kPZj84rRoDSfDq/C/nEy/AzoufqXFpYCvJerz2aAr1ONqA8lyUqHdALo937/", + "8A/VkAuwWeAI1ZNriio3IJlaWFgvpfeklnN8aw3Vn2R/hKlVs7Pl7caWZT090v6pBF7+JeGtWfzoa+3+", + "DK2z7MnQWqmMEvotc3r1te6QiuwgWuCf6NXsneft/KksRMTzkMz01tkKkHPoU8U8f2f7SbW84FeBOK3l", + "OVgqbwVLUmKdV0Ci5ThZImfxWA3HEpWX83OSWjyQsAxbW7/PmLg7S5Pp+ik6+AdS9Irs9iYRk/hMvBwr", + "Y2Vt/M8A8AsnwoXr0bqQrpENfyVIXz9pL6AZ/+eI80XPKjdI3eoUPa1K6JCfy3nMJt6YCVkWUzIaAS9T", + "ZpKQmpMaVlClhy6yqIVyPx/Ny3HKntzb5YtuK98oUpH+R4p0xq5XVEdGHqTsg5M6MtehPdlapqrkG41l", + "Xc4KpGaufUMWBQ6SbGFgVn4UkLnyxZfx/wIAAP//YEiMGr4lAAA=", } // GetSwagger returns the content of the embedded swagger specification file diff --git a/pkg/server/api/admin/admin.yaml b/pkg/server/api/admin/admin.yaml index dddac624..7610b648 100644 --- a/pkg/server/api/admin/admin.yaml +++ b/pkg/server/api/admin/admin.yaml @@ -20,7 +20,7 @@ tags: - name: Join Token description: Representation of a join token bound to a Trust Domain. paths: - /trust-domain/{trustDomainName}: + /trust-domains/{trustDomainName}: get: operationId: GetTrustDomainByName tags: @@ -86,7 +86,7 @@ paths: default: $ref: '#/components/responses/Default' - /trust-domain: + /trust-domains: get: operationId: ListTrustDomains tags: