From 9799ea8cfdd72eb25770760a7c214bc8a0fd6728 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 1 Jul 2023 18:24:29 -0400 Subject: [PATCH] Updated api/sdk --- go.mod | 2 + go.sum | 2 - iamtf/resource_iamtf_idp.go | 4 +- .../atricore/josso-api-go/README.md | 7 + .../atricore/josso-api-go/api_default.go | 226 ++++++++ .../console-api-1.5.0-SNAPSHOT-swagger.json | 138 +++++ ...onsole-api-1.5.0-SNAPSHOT-swagger.json.new | 138 +++++ ...nsole-api-1.5.0-SNAPSHOT-swagger.json.orig | 514 +++++++++++++++++- .../atricore/josso-api-go/console.patch | 75 ++- .../josso-api-go/model_bundle_descr.go | 400 ++++++++++++++ .../josso-api-go/model_get_bundles_req.go | 141 +++++ .../josso-api-go/model_get_bundles_res.go | 215 ++++++++ .../josso-api-go/model_get_server_info_req.go | 141 +++++ .../josso-api-go/model_get_server_info_res.go | 252 +++++++++ .../atricore/josso-sdk-go/bundle.go | 40 ++ .../atricore/josso-sdk-go/client.go | 33 ++ .../github.com/atricore/josso-sdk-go/go.mod | 2 + .../github.com/atricore/josso-sdk-go/go.sum | 2 - .../github.com/atricore/josso-sdk-go/info.go | 29 + .../x/crypto/openpgp/packet/config.go | 2 +- vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go | 2 +- vendor/golang.org/x/crypto/scrypt/scrypt.go | 2 +- vendor/golang.org/x/sys/cpu/cpu.go | 2 +- vendor/golang.org/x/sys/cpu/cpu_s390x.go | 6 +- vendor/modules.txt | 3 +- 25 files changed, 2328 insertions(+), 50 deletions(-) create mode 100644 vendor/github.com/atricore/josso-api-go/model_bundle_descr.go create mode 100644 vendor/github.com/atricore/josso-api-go/model_get_bundles_req.go create mode 100644 vendor/github.com/atricore/josso-api-go/model_get_bundles_res.go create mode 100644 vendor/github.com/atricore/josso-api-go/model_get_server_info_req.go create mode 100644 vendor/github.com/atricore/josso-api-go/model_get_server_info_res.go create mode 100644 vendor/github.com/atricore/josso-sdk-go/bundle.go create mode 100644 vendor/github.com/atricore/josso-sdk-go/info.go diff --git a/go.mod b/go.mod index 5e8165f..90c950a 100644 --- a/go.mod +++ b/go.mod @@ -15,3 +15,5 @@ require ( ) replace github.com/atricore/josso-sdk-go => ../josso-sdk-go + +replace github.com/atricore/josso-api-go => ../josso-api-go diff --git a/go.sum b/go.sum index cb14eaa..e90743d 100644 --- a/go.sum +++ b/go.sum @@ -67,8 +67,6 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/atricore/josso-api-go v0.4.4 h1:aLWU6xU3xR1xbqZiiKbqtw/LroFUnqO+iPU6PH1eGfQ= -github.com/atricore/josso-api-go v0.4.4/go.mod h1:Oys9D0y1x+bvyIsnRFl6JOYiIV7KQkuToIQa+jxeuHs= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= diff --git a/iamtf/resource_iamtf_idp.go b/iamtf/resource_iamtf_idp.go index 6f2251c..d07345f 100644 --- a/iamtf/resource_iamtf_idp.go +++ b/iamtf/resource_iamtf_idp.go @@ -1524,7 +1524,7 @@ func mapSaml2EncryptionToTF(encryption string) (string, error) { // "http://www.w3.org/2001/04/xmlenc#tripledes-cbc"; switch encryption { - case "disabled": + case "", "NONE", "disabled": return "NONE", nil case "http://www.w3.org/2001/04/xmlenc#aes128-cbc": return "AES128", nil @@ -1533,6 +1533,6 @@ func mapSaml2EncryptionToTF(encryption string) (string, error) { case "http://www.w3.org/2001/04/xmlenc#tripledes-cbc": return "AES3DES", nil default: - return "", fmt.Errorf("invalid encryption type %s", encryption) + return "", fmt.Errorf("invalid encryption type [%s]", encryption) } } diff --git a/vendor/github.com/atricore/josso-api-go/README.md b/vendor/github.com/atricore/josso-api-go/README.md index 5daeaf6..c03b40d 100644 --- a/vendor/github.com/atricore/josso-api-go/README.md +++ b/vendor/github.com/atricore/josso-api-go/README.md @@ -132,6 +132,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**GetApplianceState**](docs/DefaultApi.md#getappliancestate) | **Get** /iam-deploy/appliance/state | *DefaultApi* | [**GetAppliances**](docs/DefaultApi.md#getappliances) | **Get** /iam-deploy/appliances | *DefaultApi* | [**GetBranding**](docs/DefaultApi.md#getbranding) | **Get** /iam-branding/branding | +*DefaultApi* | [**GetBundles**](docs/DefaultApi.md#getbundles) | **Get** /iam-deploy/server/bundles | *DefaultApi* | [**GetDbIdVault**](docs/DefaultApi.md#getdbidvault) | **Get** /iam-deploy/dbidvault | *DefaultApi* | [**GetDbIdVaults**](docs/DefaultApi.md#getdbidvaults) | **Get** /iam-deploy/dbidvaults | *DefaultApi* | [**GetExecEnv**](docs/DefaultApi.md#getexecenv) | **Get** /iam-deploy/execenv | @@ -156,6 +157,7 @@ Class | Method | HTTP request | Description *DefaultApi* | [**GetIdpGoogles**](docs/DefaultApi.md#getidpgoogles) | **Get** /iam-deploy/idp_googles | *DefaultApi* | [**GetIisExecEnv**](docs/DefaultApi.md#getiisexecenv) | **Get** /iam-deploy/iisexecenv | *DefaultApi* | [**GetIisExecEnvs**](docs/DefaultApi.md#getiisexecenvs) | **Get** /iam-deploy/iisexecenvs | +*DefaultApi* | [**GetInfo**](docs/DefaultApi.md#getinfo) | **Get** /iam-deploy/server/info | *DefaultApi* | [**GetIntSaml2Sp**](docs/DefaultApi.md#getintsaml2sp) | **Get** /iam-deploy/intsaml2sp | *DefaultApi* | [**GetIntSaml2Sps**](docs/DefaultApi.md#getintsaml2sps) | **Get** /iam-deploy/intsaml2sps | *DefaultApi* | [**GetJossoRs**](docs/DefaultApi.md#getjossors) | **Get** /iam-deploy/jossors | @@ -226,6 +228,7 @@ Class | Method | HTTP request | Description - [BasicAuthenticationDTO](docs/BasicAuthenticationDTO.md) - [BindAuthenticationDTO](docs/BindAuthenticationDTO.md) - [BuiltInAttributeProfileDTO](docs/BuiltInAttributeProfileDTO.md) + - [BundleDescr](docs/BundleDescr.md) - [CalcLayoutReq](docs/CalcLayoutReq.md) - [CalcLayoutRes](docs/CalcLayoutRes.md) - [CustomAuthnServiceDTO](docs/CustomAuthnServiceDTO.md) @@ -265,6 +268,8 @@ Class | Method | HTTP request | Description - [GetAppliancesRes](docs/GetAppliancesRes.md) - [GetBrandingReq](docs/GetBrandingReq.md) - [GetBrandingRes](docs/GetBrandingRes.md) + - [GetBundlesReq](docs/GetBundlesReq.md) + - [GetBundlesRes](docs/GetBundlesRes.md) - [GetDbIdVaultReq](docs/GetDbIdVaultReq.md) - [GetDbIdVaultRes](docs/GetDbIdVaultRes.md) - [GetDbIdVaultsRes](docs/GetDbIdVaultsRes.md) @@ -320,6 +325,8 @@ Class | Method | HTTP request | Description - [GetSelfSvcRsReq](docs/GetSelfSvcRsReq.md) - [GetSelfSvcRsRes](docs/GetSelfSvcRsRes.md) - [GetSelfSvcRssRes](docs/GetSelfSvcRssRes.md) + - [GetServerInfoReq](docs/GetServerInfoReq.md) + - [GetServerInfoRes](docs/GetServerInfoRes.md) - [GetSharepointRsReq](docs/GetSharepointRsReq.md) - [GetSharepointRsRes](docs/GetSharepointRsRes.md) - [GetSharepointRssRes](docs/GetSharepointRssRes.md) diff --git a/vendor/github.com/atricore/josso-api-go/api_default.go b/vendor/github.com/atricore/josso-api-go/api_default.go index 21c9712..4448fe0 100644 --- a/vendor/github.com/atricore/josso-api-go/api_default.go +++ b/vendor/github.com/atricore/josso-api-go/api_default.go @@ -6012,6 +6012,119 @@ func (a *DefaultApiService) GetBrandingExecute(r ApiGetBrandingRequest) (*GetBra return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetBundlesRequest struct { + ctx context.Context + ApiService *DefaultApiService + getBundlesReq *GetBundlesReq +} + +func (r ApiGetBundlesRequest) GetBundlesReq(getBundlesReq GetBundlesReq) ApiGetBundlesRequest { + r.getBundlesReq = &getBundlesReq + return r +} + +func (r ApiGetBundlesRequest) Execute() (*GetBundlesRes, *http.Response, error) { + return r.ApiService.GetBundlesExecute(r) +} + +/* +GetBundles Method for GetBundles + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetBundlesRequest +*/ +func (a *DefaultApiService) GetBundles(ctx context.Context) ApiGetBundlesRequest { + return ApiGetBundlesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetBundlesRes +func (a *DefaultApiService) GetBundlesExecute(r ApiGetBundlesRequest) (*GetBundlesRes, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBundlesRes + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetBundles") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/iam-deploy/server/bundles" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getBundlesReq + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v GetBundlesRes + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetDbIdVaultRequest struct { ctx context.Context ApiService *DefaultApiService @@ -8724,6 +8837,119 @@ func (a *DefaultApiService) GetIisExecEnvsExecute(r ApiGetIisExecEnvsRequest) (* return localVarReturnValue, localVarHTTPResponse, nil } +type ApiGetInfoRequest struct { + ctx context.Context + ApiService *DefaultApiService + getServerInfoReq *GetServerInfoReq +} + +func (r ApiGetInfoRequest) GetServerInfoReq(getServerInfoReq GetServerInfoReq) ApiGetInfoRequest { + r.getServerInfoReq = &getServerInfoReq + return r +} + +func (r ApiGetInfoRequest) Execute() (*GetServerInfoRes, *http.Response, error) { + return r.ApiService.GetInfoExecute(r) +} + +/* +GetInfo Method for GetInfo + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetInfoRequest +*/ +func (a *DefaultApiService) GetInfo(ctx context.Context) ApiGetInfoRequest { + return ApiGetInfoRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return GetServerInfoRes +func (a *DefaultApiService) GetInfoExecute(r ApiGetInfoRequest) (*GetServerInfoRes, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetServerInfoRes + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInfo") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/iam-deploy/server/info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.getServerInfoReq + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v GetServerInfoRes + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiGetIntSaml2SpRequest struct { ctx context.Context ApiService *DefaultApiService diff --git a/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json b/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json index 1ce6ae7..04f6778 100644 --- a/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json +++ b/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json @@ -2691,6 +2691,58 @@ } } }, + "/iam-deploy/server/bundles" : { + "get" : { + "operationId" : "getBundles", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetBundlesReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetBundlesRes" + } + } + } + } + } + } + }, + "/iam-deploy/server/info" : { + "get" : { + "operationId" : "getInfo", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetServerInfoReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetServerInfoRes" + } + } + } + } + } + } + }, "/iam-deploy/sharepointrs" : { "get" : { "operationId" : "getSharepointRs", @@ -3686,6 +3738,36 @@ } } }, + "BundleDescr" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "level" : { + "type" : "string" + }, + "location" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "state" : { + "type" : "string" + }, + "symbolicName" : { + "type" : "string" + }, + "updateLocation" : { + "type" : "string" + }, + "version" : { + "type" : "string" + } + } + }, "CalcLayoutReq" : { "type" : "object", "properties" : { @@ -5061,6 +5143,34 @@ } } }, + "GetBundlesReq" : { + "type" : "object", + "properties" : { + "idOrName" : { + "type" : "string" + } + } + }, + "GetBundlesRes" : { + "type" : "object", + "properties" : { + "bundles" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BundleDescr" + } + }, + "error" : { + "type" : "string" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, "GetDbIdVaultReq" : { "type" : "object", "properties" : { @@ -5948,6 +6058,34 @@ } } }, + "GetServerInfoReq" : { + "type" : "object", + "properties" : { + "idOrName" : { + "type" : "string" + } + } + }, + "GetServerInfoRes" : { + "type" : "object", + "properties" : { + "error" : { + "type" : "string" + }, + "nodeId" : { + "type" : "string" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "version" : { + "type" : "string" + } + } + }, "GetSharepointRsReq" : { "type" : "object", "properties" : { diff --git a/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.new b/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.new index 33523b0..4cb0f16 100644 --- a/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.new +++ b/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.new @@ -2691,6 +2691,58 @@ } } }, + "/iam-deploy/server/bundles" : { + "get" : { + "operationId" : "getBundles", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetBundlesReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetBundlesRes" + } + } + } + } + } + } + }, + "/iam-deploy/server/info" : { + "get" : { + "operationId" : "getInfo", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetServerInfoReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetServerInfoRes" + } + } + } + } + } + } + }, "/iam-deploy/sharepointrs" : { "get" : { "operationId" : "getSharepointRs", @@ -3686,6 +3738,36 @@ } } }, + "BundleDescr" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "level" : { + "type" : "string" + }, + "location" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "state" : { + "type" : "string" + }, + "symbolicName" : { + "type" : "string" + }, + "updateLocation" : { + "type" : "string" + }, + "version" : { + "type" : "string" + } + } + }, "CalcLayoutReq" : { "type" : "object", "properties" : { @@ -5069,6 +5151,34 @@ } } }, + "GetBundlesReq" : { + "type" : "object", + "properties" : { + "idOrName" : { + "type" : "string" + } + } + }, + "GetBundlesRes" : { + "type" : "object", + "properties" : { + "bundles" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/BundleDescr" + } + }, + "error" : { + "type" : "string" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, "GetDbIdVaultReq" : { "type" : "object", "properties" : { @@ -5956,6 +6066,34 @@ } } }, + "GetServerInfoReq" : { + "type" : "object", + "properties" : { + "idOrName" : { + "type" : "string" + } + } + }, + "GetServerInfoRes" : { + "type" : "object", + "properties" : { + "error" : { + "type" : "string" + }, + "nodeId" : { + "type" : "string" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "version" : { + "type" : "string" + } + } + }, "GetSharepointRsReq" : { "type" : "object", "properties" : { diff --git a/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.orig b/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.orig index f658aae..1ce6ae7 100644 --- a/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.orig +++ b/vendor/github.com/atricore/josso-api-go/console-api-1.5.0-SNAPSHOT-swagger.json.orig @@ -46,6 +46,32 @@ } } }, + "/iam-authn/version" : { + "get" : { + "operationId" : "version", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ServerVersionRequest" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ServerVersionResponse" + } + } + } + } + } + } + }, "/iam-branding/branding" : { "get" : { "operationId" : "getBranding", @@ -704,6 +730,32 @@ } } }, + "/iam-deploy/execenv" : { + "get" : { + "operationId" : "getExecEnv", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetExecEnvReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetExecEnvRes" + } + } + } + } + } + } + }, "/iam-deploy/execenv/activate" : { "get" : { "operationId" : "activateExecEnv", @@ -756,6 +808,32 @@ } } }, + "/iam-deploy/execenvs" : { + "get" : { + "operationId" : "getExecEnvs", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetApplianceReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetExecEnvsRes" + } + } + } + } + } + } + }, "/iam-deploy/extsaml2sp" : { "get" : { "operationId" : "getExtSaml2Sp", @@ -2489,6 +2567,130 @@ } } }, + "/iam-deploy/selfsvc" : { + "get" : { + "operationId" : "getSelfSvcs", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetSelfSvcRsReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetSelfSvcRsRes" + } + } + } + } + } + }, + "put" : { + "operationId" : "updateSelfSvcs", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StoreSelfSvcRsReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StoreSelfSvcRsRes" + } + } + } + } + } + }, + "post" : { + "operationId" : "createSelfSvcs", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StoreSelfSvcRsReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/StoreSelfSvcRsRes" + } + } + } + } + } + }, + "delete" : { + "operationId" : "deleteSelfSvcs", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/DeleteReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/DeleteRes" + } + } + } + } + } + } + }, + "/iam-deploy/selfsvcs" : { + "get" : { + "operationId" : "getSelfSvcss", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetSelfSvcRsReq" + } + } + } + }, + "responses" : { + "default" : { + "description" : "default response", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/GetSelfSvcRssRes" + } + } + } + } + } + } + }, "/iam-deploy/sharepointrs" : { "get" : { "operationId" : "getSharepointRs", @@ -3465,31 +3667,6 @@ } } }, - "BrandingDefinitionDTO" : { - "type" : "object", - "properties" : { - "defaultLocale" : { - "type" : "string" - }, - "description" : { - "type" : "string" - }, - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - }, - "type" : { - "type" : "string", - "enum" : [ "BUILT_IN", "CUSTOM" ] - }, - "webBrandingId" : { - "type" : "string" - } - } - }, "BuiltInAttributeProfileDTO" : { "type" : "object", "properties" : { @@ -3537,6 +3714,63 @@ } } }, + "CustomAuthnServiceDTO" : { + "type" : "object", + "properties" : { + "authnCtxClass" : { + "type" : "string" + }, + "authnMechanismType" : { + "type" : "string" + }, + "customClass" : { + "$ref" : "#/components/schemas/CustomClassDTO" + }, + "delegatedAuthentications" : { + "uniqueItems" : true, + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/DelegatedAuthenticationDTO" + } + }, + "description" : { + "type" : "string" + }, + "displayName" : { + "type" : "string" + }, + "elementId" : { + "type" : "string" + }, + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + }, + "preAuthnClaimCollectorConfig" : { + "type" : "string" + }, + "preAuthnClaimCollectorType" : { + "type" : "string" + }, + "preAuthnServiceURL" : { + "type" : "string" + }, + "useCredentialStore" : { + "type" : "boolean" + }, + "x" : { + "type" : "number", + "format" : "double" + }, + "y" : { + "type" : "number", + "format" : "double" + } + } + }, "CustomBrandingDefinitionDTO" : { "type" : "object", "properties" : { @@ -3991,6 +4225,26 @@ } } }, + "ExecEnvContainerDTO" : { + "type" : "object", + "properties" : { + "captive" : { + "type" : "boolean" + }, + "execEnv" : { + "$ref" : "#/components/schemas/ExecutionEnvironmentDTO" + }, + "location" : { + "type" : "string" + }, + "name" : { + "type" : "string" + }, + "type" : { + "type" : "string" + } + } + }, "ExecutionEnvironmentDTO" : { "type" : "object", "properties" : { @@ -4653,7 +4907,7 @@ "brandings" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/BrandingDefinitionDTO" + "$ref" : "#/components/schemas/CustomBrandingDefinitionDTO" } }, "error" : { @@ -4858,6 +5112,54 @@ } } }, + "GetExecEnvReq" : { + "type" : "object", + "properties" : { + "idOrName" : { + "type" : "string" + }, + "name" : { + "type" : "string" + } + } + }, + "GetExecEnvRes" : { + "type" : "object", + "properties" : { + "error" : { + "type" : "string" + }, + "execEnv" : { + "$ref" : "#/components/schemas/ExecEnvContainerDTO" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "GetExecEnvsRes" : { + "type" : "object", + "properties" : { + "error" : { + "type" : "string" + }, + "execEnvs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ExecEnvContainerDTO" + } + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, "GetExtSaml2SpReq" : { "type" : "object", "properties" : { @@ -5598,6 +5900,54 @@ } } }, + "GetSelfSvcRsReq" : { + "type" : "object", + "properties" : { + "idOrName" : { + "type" : "string" + }, + "name" : { + "type" : "string" + } + } + }, + "GetSelfSvcRsRes" : { + "type" : "object", + "properties" : { + "error" : { + "type" : "string" + }, + "resource" : { + "$ref" : "#/components/schemas/SelfServicesResourceDTO" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "GetSelfSvcRssRes" : { + "type" : "object", + "properties" : { + "error" : { + "type" : "string" + }, + "resources" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SelfServicesResourceDTO" + } + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, "GetSharepointRsReq" : { "type" : "object", "properties" : { @@ -5709,6 +6059,9 @@ "builtInAttributeProfile" : { "$ref" : "#/components/schemas/BuiltInAttributeProfileDTO" }, + "customAuthSvc" : { + "$ref" : "#/components/schemas/CustomAuthnServiceDTO" + }, "directoryAuthnSvc" : { "$ref" : "#/components/schemas/DirectoryAuthenticationServiceDTO" }, @@ -5977,6 +6330,12 @@ "appliance" : { "$ref" : "#/components/schemas/IdentityApplianceDTO" }, + "execEnvs" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, "idSources" : { "type" : "array", "items" : { @@ -6569,6 +6928,9 @@ "type" : "integer", "format" : "int32" }, + "oidcIncludeUserClaimsInAccessToken" : { + "type" : "boolean" + }, "openIdEnabled" : { "type" : "boolean" }, @@ -7360,6 +7722,12 @@ "name" : { "type" : "string" }, + "serviceResource" : { + "$ref" : "#/components/schemas/ServiceResourceDTO" + }, + "serviceResourceType" : { + "type" : "string" + }, "type" : { "type" : "string" } @@ -7533,6 +7901,44 @@ } } }, + "SelfServicesResourceDTO" : { + "type" : "object", + "properties" : { + "activation" : { + "$ref" : "#/components/schemas/ActivationDTO" + }, + "description" : { + "type" : "string" + }, + "elementId" : { + "type" : "string" + }, + "id" : { + "type" : "integer", + "format" : "int64" + }, + "location" : { + "$ref" : "#/components/schemas/LocationDTO" + }, + "name" : { + "type" : "string" + }, + "secret" : { + "type" : "string" + }, + "serviceConnection" : { + "$ref" : "#/components/schemas/ServiceConnectionDTO" + }, + "x" : { + "type" : "number", + "format" : "double" + }, + "y" : { + "type" : "number", + "format" : "double" + } + } + }, "ServerContext" : { "type" : "object", "properties" : { @@ -7547,6 +7953,31 @@ } } }, + "ServerVersionRequest" : { + "type" : "object", + "properties" : { + "server" : { + "$ref" : "#/components/schemas/ServerContext" + } + } + }, + "ServerVersionResponse" : { + "type" : "object", + "properties" : { + "server" : { + "$ref" : "#/components/schemas/ServerContext" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "version" : { + "type" : "string" + } + } + }, "ServiceConnectionDTO" : { "type" : "object", "properties" : { @@ -8162,6 +8593,34 @@ } } }, + "StoreSelfSvcRsReq" : { + "type" : "object", + "properties" : { + "idOrName" : { + "type" : "string" + }, + "resource" : { + "$ref" : "#/components/schemas/SelfServicesResourceDTO" + } + } + }, + "StoreSelfSvcRsRes" : { + "type" : "object", + "properties" : { + "error" : { + "type" : "string" + }, + "resource" : { + "$ref" : "#/components/schemas/SelfServicesResourceDTO" + }, + "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, "StoreSharepointRsReq" : { "type" : "object", "properties" : { @@ -8724,6 +9183,9 @@ "type" : "integer", "format" : "int32" }, + "oidcIncludeUserClaimsInAccessToken" : { + "type" : "boolean" + }, "openIdEnabled" : { "type" : "boolean" }, diff --git a/vendor/github.com/atricore/josso-api-go/console.patch b/vendor/github.com/atricore/josso-api-go/console.patch index bc37a63..0c878f6 100644 --- a/vendor/github.com/atricore/josso-api-go/console.patch +++ b/vendor/github.com/atricore/josso-api-go/console.patch @@ -1,15 +1,70 @@ ---- console-api-1.5.0-SNAPSHOT-swagger.json 2023-06-02 10:31:57.113717622 -0400 -+++ console-api-1.5.0-SNAPSHOT-swagger.json.new 2023-06-02 12:38:00.187008182 -0400 -@@ -6330,6 +6338,12 @@ - "appliance" : { - "$ref" : "#/components/schemas/IdentityApplianceDTO" - }, -+ "execEnvs" : { +--- console-api-1.5.0-SNAPSHOT-swagger.json 2023-06-30 11:30:00.405422554 -0400 ++++ console-api-1.5.0-SNAPSHOT-swagger.json.new 2023-07-01 15:36:35.304120831 -0400 +@@ -2717,6 +2717,32 @@ + } + } + }, ++ "/iam-deploy/server/info" : { ++ "get" : { ++ "operationId" : "getInfo", ++ "requestBody" : { ++ "content" : { ++ "application/json" : { ++ "schema" : { ++ "$ref" : "#/components/schemas/GetServerInfoReq" ++ } ++ } ++ } ++ }, ++ "responses" : { ++ "default" : { ++ "description" : "default response", ++ "content" : { ++ "application/json" : { ++ "schema" : { ++ "$ref" : "#/components/schemas/GetServerInfoRes" ++ } ++ } ++ } ++ } ++ } ++ } ++ }, + "/iam-deploy/sharepointrs" : { + "get" : { + "operationId" : "getSharepointRs", +@@ -6032,6 +6066,34 @@ + } + } + }, ++ "GetServerInfoReq" : { ++ "type" : "object", ++ "properties" : { ++ "idOrName" : { ++ "type" : "string" ++ } ++ } ++ }, ++ "GetServerInfoRes" : { ++ "type" : "object", ++ "properties" : { ++ "error" : { ++ "type" : "string" ++ }, ++ "nodeId" : { ++ "type" : "string" ++ }, ++ "validationErrors" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, - "idSources" : { - "type" : "array", - "items" : { ++ "version" : { ++ "type" : "string" ++ } ++ } ++ }, + "GetSharepointRsReq" : { + "type" : "object", + "properties" : { diff --git a/vendor/github.com/atricore/josso-api-go/model_bundle_descr.go b/vendor/github.com/atricore/josso-api-go/model_bundle_descr.go new file mode 100644 index 0000000..883e719 --- /dev/null +++ b/vendor/github.com/atricore/josso-api-go/model_bundle_descr.go @@ -0,0 +1,400 @@ +/* +Atricore Console :: Remote : API + +# Atricore Console API + +API version: 1.5.0-SNAPSHOT +Contact: sgonzalez@atricore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package jossoappi + +import ( + "encoding/json" +) + +// BundleDescr struct for BundleDescr +type BundleDescr struct { + Id *int64 `json:"id,omitempty"` + Level *string `json:"level,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + State *string `json:"state,omitempty"` + SymbolicName *string `json:"symbolicName,omitempty"` + UpdateLocation *string `json:"updateLocation,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BundleDescr BundleDescr + +// NewBundleDescr instantiates a new BundleDescr object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBundleDescr() *BundleDescr { + this := BundleDescr{} + return &this +} + +// NewBundleDescrWithDefaults instantiates a new BundleDescr object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBundleDescrWithDefaults() *BundleDescr { + this := BundleDescr{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BundleDescr) GetId() int64 { + if o == nil || isNil(o.Id) { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetIdOk() (*int64, bool) { + if o == nil || isNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BundleDescr) HasId() bool { + if o != nil && !isNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *BundleDescr) SetId(v int64) { + o.Id = &v +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *BundleDescr) GetLevel() string { + if o == nil || isNil(o.Level) { + var ret string + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetLevelOk() (*string, bool) { + if o == nil || isNil(o.Level) { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *BundleDescr) HasLevel() bool { + if o != nil && !isNil(o.Level) { + return true + } + + return false +} + +// SetLevel gets a reference to the given string and assigns it to the Level field. +func (o *BundleDescr) SetLevel(v string) { + o.Level = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *BundleDescr) GetLocation() string { + if o == nil || isNil(o.Location) { + var ret string + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetLocationOk() (*string, bool) { + if o == nil || isNil(o.Location) { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *BundleDescr) HasLocation() bool { + if o != nil && !isNil(o.Location) { + return true + } + + return false +} + +// SetLocation gets a reference to the given string and assigns it to the Location field. +func (o *BundleDescr) SetLocation(v string) { + o.Location = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BundleDescr) GetName() string { + if o == nil || isNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetNameOk() (*string, bool) { + if o == nil || isNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *BundleDescr) HasName() bool { + if o != nil && !isNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *BundleDescr) SetName(v string) { + o.Name = &v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *BundleDescr) GetState() string { + if o == nil || isNil(o.State) { + var ret string + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetStateOk() (*string, bool) { + if o == nil || isNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *BundleDescr) HasState() bool { + if o != nil && !isNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given string and assigns it to the State field. +func (o *BundleDescr) SetState(v string) { + o.State = &v +} + +// GetSymbolicName returns the SymbolicName field value if set, zero value otherwise. +func (o *BundleDescr) GetSymbolicName() string { + if o == nil || isNil(o.SymbolicName) { + var ret string + return ret + } + return *o.SymbolicName +} + +// GetSymbolicNameOk returns a tuple with the SymbolicName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetSymbolicNameOk() (*string, bool) { + if o == nil || isNil(o.SymbolicName) { + return nil, false + } + return o.SymbolicName, true +} + +// HasSymbolicName returns a boolean if a field has been set. +func (o *BundleDescr) HasSymbolicName() bool { + if o != nil && !isNil(o.SymbolicName) { + return true + } + + return false +} + +// SetSymbolicName gets a reference to the given string and assigns it to the SymbolicName field. +func (o *BundleDescr) SetSymbolicName(v string) { + o.SymbolicName = &v +} + +// GetUpdateLocation returns the UpdateLocation field value if set, zero value otherwise. +func (o *BundleDescr) GetUpdateLocation() string { + if o == nil || isNil(o.UpdateLocation) { + var ret string + return ret + } + return *o.UpdateLocation +} + +// GetUpdateLocationOk returns a tuple with the UpdateLocation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetUpdateLocationOk() (*string, bool) { + if o == nil || isNil(o.UpdateLocation) { + return nil, false + } + return o.UpdateLocation, true +} + +// HasUpdateLocation returns a boolean if a field has been set. +func (o *BundleDescr) HasUpdateLocation() bool { + if o != nil && !isNil(o.UpdateLocation) { + return true + } + + return false +} + +// SetUpdateLocation gets a reference to the given string and assigns it to the UpdateLocation field. +func (o *BundleDescr) SetUpdateLocation(v string) { + o.UpdateLocation = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *BundleDescr) GetVersion() string { + if o == nil || isNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BundleDescr) GetVersionOk() (*string, bool) { + if o == nil || isNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *BundleDescr) HasVersion() bool { + if o != nil && !isNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *BundleDescr) SetVersion(v string) { + o.Version = &v +} + +func (o BundleDescr) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Id) { + toSerialize["id"] = o.Id + } + if !isNil(o.Level) { + toSerialize["level"] = o.Level + } + if !isNil(o.Location) { + toSerialize["location"] = o.Location + } + if !isNil(o.Name) { + toSerialize["name"] = o.Name + } + if !isNil(o.State) { + toSerialize["state"] = o.State + } + if !isNil(o.SymbolicName) { + toSerialize["symbolicName"] = o.SymbolicName + } + if !isNil(o.UpdateLocation) { + toSerialize["updateLocation"] = o.UpdateLocation + } + if !isNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *BundleDescr) UnmarshalJSON(bytes []byte) (err error) { + varBundleDescr := _BundleDescr{} + + if err = json.Unmarshal(bytes, &varBundleDescr); err == nil { + *o = BundleDescr(varBundleDescr) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "level") + delete(additionalProperties, "location") + delete(additionalProperties, "name") + delete(additionalProperties, "state") + delete(additionalProperties, "symbolicName") + delete(additionalProperties, "updateLocation") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBundleDescr struct { + value *BundleDescr + isSet bool +} + +func (v NullableBundleDescr) Get() *BundleDescr { + return v.value +} + +func (v *NullableBundleDescr) Set(val *BundleDescr) { + v.value = val + v.isSet = true +} + +func (v NullableBundleDescr) IsSet() bool { + return v.isSet +} + +func (v *NullableBundleDescr) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBundleDescr(val *BundleDescr) *NullableBundleDescr { + return &NullableBundleDescr{value: val, isSet: true} +} + +func (v NullableBundleDescr) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBundleDescr) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/atricore/josso-api-go/model_get_bundles_req.go b/vendor/github.com/atricore/josso-api-go/model_get_bundles_req.go new file mode 100644 index 0000000..0871b16 --- /dev/null +++ b/vendor/github.com/atricore/josso-api-go/model_get_bundles_req.go @@ -0,0 +1,141 @@ +/* +Atricore Console :: Remote : API + +# Atricore Console API + +API version: 1.5.0-SNAPSHOT +Contact: sgonzalez@atricore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package jossoappi + +import ( + "encoding/json" +) + +// GetBundlesReq struct for GetBundlesReq +type GetBundlesReq struct { + IdOrName *string `json:"idOrName,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetBundlesReq GetBundlesReq + +// NewGetBundlesReq instantiates a new GetBundlesReq object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBundlesReq() *GetBundlesReq { + this := GetBundlesReq{} + return &this +} + +// NewGetBundlesReqWithDefaults instantiates a new GetBundlesReq object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBundlesReqWithDefaults() *GetBundlesReq { + this := GetBundlesReq{} + return &this +} + +// GetIdOrName returns the IdOrName field value if set, zero value otherwise. +func (o *GetBundlesReq) GetIdOrName() string { + if o == nil || isNil(o.IdOrName) { + var ret string + return ret + } + return *o.IdOrName +} + +// GetIdOrNameOk returns a tuple with the IdOrName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBundlesReq) GetIdOrNameOk() (*string, bool) { + if o == nil || isNil(o.IdOrName) { + return nil, false + } + return o.IdOrName, true +} + +// HasIdOrName returns a boolean if a field has been set. +func (o *GetBundlesReq) HasIdOrName() bool { + if o != nil && !isNil(o.IdOrName) { + return true + } + + return false +} + +// SetIdOrName gets a reference to the given string and assigns it to the IdOrName field. +func (o *GetBundlesReq) SetIdOrName(v string) { + o.IdOrName = &v +} + +func (o GetBundlesReq) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.IdOrName) { + toSerialize["idOrName"] = o.IdOrName + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *GetBundlesReq) UnmarshalJSON(bytes []byte) (err error) { + varGetBundlesReq := _GetBundlesReq{} + + if err = json.Unmarshal(bytes, &varGetBundlesReq); err == nil { + *o = GetBundlesReq(varGetBundlesReq) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "idOrName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetBundlesReq struct { + value *GetBundlesReq + isSet bool +} + +func (v NullableGetBundlesReq) Get() *GetBundlesReq { + return v.value +} + +func (v *NullableGetBundlesReq) Set(val *GetBundlesReq) { + v.value = val + v.isSet = true +} + +func (v NullableGetBundlesReq) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBundlesReq) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBundlesReq(val *GetBundlesReq) *NullableGetBundlesReq { + return &NullableGetBundlesReq{value: val, isSet: true} +} + +func (v NullableGetBundlesReq) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBundlesReq) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/atricore/josso-api-go/model_get_bundles_res.go b/vendor/github.com/atricore/josso-api-go/model_get_bundles_res.go new file mode 100644 index 0000000..1321aac --- /dev/null +++ b/vendor/github.com/atricore/josso-api-go/model_get_bundles_res.go @@ -0,0 +1,215 @@ +/* +Atricore Console :: Remote : API + +# Atricore Console API + +API version: 1.5.0-SNAPSHOT +Contact: sgonzalez@atricore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package jossoappi + +import ( + "encoding/json" +) + +// GetBundlesRes struct for GetBundlesRes +type GetBundlesRes struct { + Bundles []BundleDescr `json:"bundles,omitempty"` + Error *string `json:"error,omitempty"` + ValidationErrors []string `json:"validationErrors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetBundlesRes GetBundlesRes + +// NewGetBundlesRes instantiates a new GetBundlesRes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetBundlesRes() *GetBundlesRes { + this := GetBundlesRes{} + return &this +} + +// NewGetBundlesResWithDefaults instantiates a new GetBundlesRes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetBundlesResWithDefaults() *GetBundlesRes { + this := GetBundlesRes{} + return &this +} + +// GetBundles returns the Bundles field value if set, zero value otherwise. +func (o *GetBundlesRes) GetBundles() []BundleDescr { + if o == nil || isNil(o.Bundles) { + var ret []BundleDescr + return ret + } + return o.Bundles +} + +// GetBundlesOk returns a tuple with the Bundles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBundlesRes) GetBundlesOk() ([]BundleDescr, bool) { + if o == nil || isNil(o.Bundles) { + return nil, false + } + return o.Bundles, true +} + +// HasBundles returns a boolean if a field has been set. +func (o *GetBundlesRes) HasBundles() bool { + if o != nil && !isNil(o.Bundles) { + return true + } + + return false +} + +// SetBundles gets a reference to the given []BundleDescr and assigns it to the Bundles field. +func (o *GetBundlesRes) SetBundles(v []BundleDescr) { + o.Bundles = v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *GetBundlesRes) GetError() string { + if o == nil || isNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBundlesRes) GetErrorOk() (*string, bool) { + if o == nil || isNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *GetBundlesRes) HasError() bool { + if o != nil && !isNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *GetBundlesRes) SetError(v string) { + o.Error = &v +} + +// GetValidationErrors returns the ValidationErrors field value if set, zero value otherwise. +func (o *GetBundlesRes) GetValidationErrors() []string { + if o == nil || isNil(o.ValidationErrors) { + var ret []string + return ret + } + return o.ValidationErrors +} + +// GetValidationErrorsOk returns a tuple with the ValidationErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBundlesRes) GetValidationErrorsOk() ([]string, bool) { + if o == nil || isNil(o.ValidationErrors) { + return nil, false + } + return o.ValidationErrors, true +} + +// HasValidationErrors returns a boolean if a field has been set. +func (o *GetBundlesRes) HasValidationErrors() bool { + if o != nil && !isNil(o.ValidationErrors) { + return true + } + + return false +} + +// SetValidationErrors gets a reference to the given []string and assigns it to the ValidationErrors field. +func (o *GetBundlesRes) SetValidationErrors(v []string) { + o.ValidationErrors = v +} + +func (o GetBundlesRes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Bundles) { + toSerialize["bundles"] = o.Bundles + } + if !isNil(o.Error) { + toSerialize["error"] = o.Error + } + if !isNil(o.ValidationErrors) { + toSerialize["validationErrors"] = o.ValidationErrors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *GetBundlesRes) UnmarshalJSON(bytes []byte) (err error) { + varGetBundlesRes := _GetBundlesRes{} + + if err = json.Unmarshal(bytes, &varGetBundlesRes); err == nil { + *o = GetBundlesRes(varGetBundlesRes) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "bundles") + delete(additionalProperties, "error") + delete(additionalProperties, "validationErrors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetBundlesRes struct { + value *GetBundlesRes + isSet bool +} + +func (v NullableGetBundlesRes) Get() *GetBundlesRes { + return v.value +} + +func (v *NullableGetBundlesRes) Set(val *GetBundlesRes) { + v.value = val + v.isSet = true +} + +func (v NullableGetBundlesRes) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBundlesRes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBundlesRes(val *GetBundlesRes) *NullableGetBundlesRes { + return &NullableGetBundlesRes{value: val, isSet: true} +} + +func (v NullableGetBundlesRes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBundlesRes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/atricore/josso-api-go/model_get_server_info_req.go b/vendor/github.com/atricore/josso-api-go/model_get_server_info_req.go new file mode 100644 index 0000000..614b6ac --- /dev/null +++ b/vendor/github.com/atricore/josso-api-go/model_get_server_info_req.go @@ -0,0 +1,141 @@ +/* +Atricore Console :: Remote : API + +# Atricore Console API + +API version: 1.5.0-SNAPSHOT +Contact: sgonzalez@atricore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package jossoappi + +import ( + "encoding/json" +) + +// GetServerInfoReq struct for GetServerInfoReq +type GetServerInfoReq struct { + IdOrName *string `json:"idOrName,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetServerInfoReq GetServerInfoReq + +// NewGetServerInfoReq instantiates a new GetServerInfoReq object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetServerInfoReq() *GetServerInfoReq { + this := GetServerInfoReq{} + return &this +} + +// NewGetServerInfoReqWithDefaults instantiates a new GetServerInfoReq object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetServerInfoReqWithDefaults() *GetServerInfoReq { + this := GetServerInfoReq{} + return &this +} + +// GetIdOrName returns the IdOrName field value if set, zero value otherwise. +func (o *GetServerInfoReq) GetIdOrName() string { + if o == nil || isNil(o.IdOrName) { + var ret string + return ret + } + return *o.IdOrName +} + +// GetIdOrNameOk returns a tuple with the IdOrName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerInfoReq) GetIdOrNameOk() (*string, bool) { + if o == nil || isNil(o.IdOrName) { + return nil, false + } + return o.IdOrName, true +} + +// HasIdOrName returns a boolean if a field has been set. +func (o *GetServerInfoReq) HasIdOrName() bool { + if o != nil && !isNil(o.IdOrName) { + return true + } + + return false +} + +// SetIdOrName gets a reference to the given string and assigns it to the IdOrName field. +func (o *GetServerInfoReq) SetIdOrName(v string) { + o.IdOrName = &v +} + +func (o GetServerInfoReq) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.IdOrName) { + toSerialize["idOrName"] = o.IdOrName + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *GetServerInfoReq) UnmarshalJSON(bytes []byte) (err error) { + varGetServerInfoReq := _GetServerInfoReq{} + + if err = json.Unmarshal(bytes, &varGetServerInfoReq); err == nil { + *o = GetServerInfoReq(varGetServerInfoReq) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "idOrName") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetServerInfoReq struct { + value *GetServerInfoReq + isSet bool +} + +func (v NullableGetServerInfoReq) Get() *GetServerInfoReq { + return v.value +} + +func (v *NullableGetServerInfoReq) Set(val *GetServerInfoReq) { + v.value = val + v.isSet = true +} + +func (v NullableGetServerInfoReq) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServerInfoReq) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServerInfoReq(val *GetServerInfoReq) *NullableGetServerInfoReq { + return &NullableGetServerInfoReq{value: val, isSet: true} +} + +func (v NullableGetServerInfoReq) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServerInfoReq) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/atricore/josso-api-go/model_get_server_info_res.go b/vendor/github.com/atricore/josso-api-go/model_get_server_info_res.go new file mode 100644 index 0000000..a05c850 --- /dev/null +++ b/vendor/github.com/atricore/josso-api-go/model_get_server_info_res.go @@ -0,0 +1,252 @@ +/* +Atricore Console :: Remote : API + +# Atricore Console API + +API version: 1.5.0-SNAPSHOT +Contact: sgonzalez@atricore.com +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package jossoappi + +import ( + "encoding/json" +) + +// GetServerInfoRes struct for GetServerInfoRes +type GetServerInfoRes struct { + Error *string `json:"error,omitempty"` + NodeId *string `json:"nodeId,omitempty"` + ValidationErrors []string `json:"validationErrors,omitempty"` + Version *string `json:"version,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetServerInfoRes GetServerInfoRes + +// NewGetServerInfoRes instantiates a new GetServerInfoRes object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetServerInfoRes() *GetServerInfoRes { + this := GetServerInfoRes{} + return &this +} + +// NewGetServerInfoResWithDefaults instantiates a new GetServerInfoRes object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetServerInfoResWithDefaults() *GetServerInfoRes { + this := GetServerInfoRes{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *GetServerInfoRes) GetError() string { + if o == nil || isNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerInfoRes) GetErrorOk() (*string, bool) { + if o == nil || isNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *GetServerInfoRes) HasError() bool { + if o != nil && !isNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *GetServerInfoRes) SetError(v string) { + o.Error = &v +} + +// GetNodeId returns the NodeId field value if set, zero value otherwise. +func (o *GetServerInfoRes) GetNodeId() string { + if o == nil || isNil(o.NodeId) { + var ret string + return ret + } + return *o.NodeId +} + +// GetNodeIdOk returns a tuple with the NodeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerInfoRes) GetNodeIdOk() (*string, bool) { + if o == nil || isNil(o.NodeId) { + return nil, false + } + return o.NodeId, true +} + +// HasNodeId returns a boolean if a field has been set. +func (o *GetServerInfoRes) HasNodeId() bool { + if o != nil && !isNil(o.NodeId) { + return true + } + + return false +} + +// SetNodeId gets a reference to the given string and assigns it to the NodeId field. +func (o *GetServerInfoRes) SetNodeId(v string) { + o.NodeId = &v +} + +// GetValidationErrors returns the ValidationErrors field value if set, zero value otherwise. +func (o *GetServerInfoRes) GetValidationErrors() []string { + if o == nil || isNil(o.ValidationErrors) { + var ret []string + return ret + } + return o.ValidationErrors +} + +// GetValidationErrorsOk returns a tuple with the ValidationErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerInfoRes) GetValidationErrorsOk() ([]string, bool) { + if o == nil || isNil(o.ValidationErrors) { + return nil, false + } + return o.ValidationErrors, true +} + +// HasValidationErrors returns a boolean if a field has been set. +func (o *GetServerInfoRes) HasValidationErrors() bool { + if o != nil && !isNil(o.ValidationErrors) { + return true + } + + return false +} + +// SetValidationErrors gets a reference to the given []string and assigns it to the ValidationErrors field. +func (o *GetServerInfoRes) SetValidationErrors(v []string) { + o.ValidationErrors = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *GetServerInfoRes) GetVersion() string { + if o == nil || isNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerInfoRes) GetVersionOk() (*string, bool) { + if o == nil || isNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *GetServerInfoRes) HasVersion() bool { + if o != nil && !isNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *GetServerInfoRes) SetVersion(v string) { + o.Version = &v +} + +func (o GetServerInfoRes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if !isNil(o.Error) { + toSerialize["error"] = o.Error + } + if !isNil(o.NodeId) { + toSerialize["nodeId"] = o.NodeId + } + if !isNil(o.ValidationErrors) { + toSerialize["validationErrors"] = o.ValidationErrors + } + if !isNil(o.Version) { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return json.Marshal(toSerialize) +} + +func (o *GetServerInfoRes) UnmarshalJSON(bytes []byte) (err error) { + varGetServerInfoRes := _GetServerInfoRes{} + + if err = json.Unmarshal(bytes, &varGetServerInfoRes); err == nil { + *o = GetServerInfoRes(varGetServerInfoRes) + } + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + delete(additionalProperties, "error") + delete(additionalProperties, "nodeId") + delete(additionalProperties, "validationErrors") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetServerInfoRes struct { + value *GetServerInfoRes + isSet bool +} + +func (v NullableGetServerInfoRes) Get() *GetServerInfoRes { + return v.value +} + +func (v *NullableGetServerInfoRes) Set(val *GetServerInfoRes) { + v.value = val + v.isSet = true +} + +func (v NullableGetServerInfoRes) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServerInfoRes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServerInfoRes(val *GetServerInfoRes) *NullableGetServerInfoRes { + return &NullableGetServerInfoRes{value: val, isSet: true} +} + +func (v NullableGetServerInfoRes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServerInfoRes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/atricore/josso-sdk-go/bundle.go b/vendor/github.com/atricore/josso-sdk-go/bundle.go new file mode 100644 index 0000000..fbeb1dd --- /dev/null +++ b/vendor/github.com/atricore/josso-sdk-go/bundle.go @@ -0,0 +1,40 @@ +package cli + +import ( + "context" + "errors" + + api "github.com/atricore/josso-api-go" +) + +func (c *IdbusApiClient) GetOSGiBundles() ([]api.BundleDescr, error) { + c.logger.Debug("get OSGiBundles: all") + var result []api.BundleDescr + + sc, err := c.IdbusServerForOperation("DefaultApiService.GetBundles") // Also hard-coded in generated client + if err != nil { + return result, err + } + + ctx := context.WithValue(context.Background(), api.ContextAccessToken, sc.Authn.AccessToken) + req := c.apiClient.DefaultApi.GetBundles(ctx) + req = req.GetBundlesReq(api.GetBundlesReq{}) + res, _, err := c.apiClient.DefaultApi.GetBundlesExecute(req) + if err != nil { + c.logger.Errorf("GetBundlesReq. Error %v", err) + return result, err + } + + if res.Error != nil { + return result, errors.New(*res.Error) + } + + if res.Bundles == nil { + return result, nil + } + + result = res.Bundles + + return result, nil + +} diff --git a/vendor/github.com/atricore/josso-sdk-go/client.go b/vendor/github.com/atricore/josso-sdk-go/client.go index 9815f0b..2f5323b 100644 --- a/vendor/github.com/atricore/josso-sdk-go/client.go +++ b/vendor/github.com/atricore/josso-sdk-go/client.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "log" + "net/url" "os" api "github.com/atricore/josso-api-go" @@ -72,6 +73,16 @@ func (c *IdbusApiClient) Logger() Logger { */ func (c *IdbusApiClient) RegisterServer(svr *IdbusServer, operation string) error { + // update URL + c.logger.Infof("registering server %s", svr.Config.URL) + if hasPath, err := endpointHasPath(svr.Config.URL); err == nil && !hasPath { + c.logger.Infof("adding path to server URL %s", svr.Config.URL) + svr.Config.URL = svr.Config.URL + "/atricore-rest/services" + } else if err != nil { + c.logger.Errorf("error processing server URL [%s] %s", svr.Config.URL, err) + return err + } + key := operation if key == "" { key = DEFAULT_SVR @@ -170,6 +181,21 @@ func ServerVersion(cfg *IdbusServer) (string, error) { } +func endpointHasPath(s string) (bool, error) { + u, err := url.Parse(s) + if err != nil { + return false, err + } + + // Ensure that the scheme is either http or https and host is not empty + if (u.Scheme != "http" && u.Scheme != "https") || u.Host == "" { + return false, errors.New("invalid URL or not http/https") + } + + // Return true if Path is not empty and false otherwise + return u.Path != "" && u.Path != "/", nil +} + func GetServerConfigFromEnv() (*IdbusServer, error) { clientSecret := os.Getenv("JOSSO_API_SECRET") @@ -179,6 +205,12 @@ func GetServerConfigFromEnv() (*IdbusServer, error) { return nil, errors.New("JOSSO variables must be set for acceptance tests") } + if hasPath, err := endpointHasPath(endpoint); !hasPath { + endpoint = endpoint + "/atricore-rest/services" + } else if err != nil { + return nil, err + } + s := IdbusServer{ Config: &api.ServerConfiguration{ URL: endpoint, @@ -200,6 +232,7 @@ func CreateClient(s *IdbusServer, authn bool) (*IdbusApiClient, error) { } l := DefaultLogger{debug: trace} + l.Debug("Using server URL [" + s.Config.URL + "]]") c := NewIdbusApiClient(&l, trace) err = c.RegisterServer(s, "") diff --git a/vendor/github.com/atricore/josso-sdk-go/go.mod b/vendor/github.com/atricore/josso-sdk-go/go.mod index 3574b23..c7ac913 100644 --- a/vendor/github.com/atricore/josso-sdk-go/go.mod +++ b/vendor/github.com/atricore/josso-sdk-go/go.mod @@ -10,3 +10,5 @@ require ( github.com/stretchr/testify v1.8.2 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) + +replace github.com/atricore/josso-api-go => ../josso-api-go diff --git a/vendor/github.com/atricore/josso-sdk-go/go.sum b/vendor/github.com/atricore/josso-sdk-go/go.sum index d32175b..91fc03d 100644 --- a/vendor/github.com/atricore/josso-sdk-go/go.sum +++ b/vendor/github.com/atricore/josso-sdk-go/go.sum @@ -33,8 +33,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9 dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/atricore/josso-api-go v0.4.4 h1:aLWU6xU3xR1xbqZiiKbqtw/LroFUnqO+iPU6PH1eGfQ= -github.com/atricore/josso-api-go v0.4.4/go.mod h1:Oys9D0y1x+bvyIsnRFl6JOYiIV7KQkuToIQa+jxeuHs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= diff --git a/vendor/github.com/atricore/josso-sdk-go/info.go b/vendor/github.com/atricore/josso-sdk-go/info.go new file mode 100644 index 0000000..ba0c01e --- /dev/null +++ b/vendor/github.com/atricore/josso-sdk-go/info.go @@ -0,0 +1,29 @@ +package cli + +import ( + "context" + + api "github.com/atricore/josso-api-go" +) + +func (c *IdbusApiClient) GetInfo() (api.GetServerInfoRes, error) { + c.logger.Debug("get Info: all") + var result api.GetServerInfoRes + + sc, err := c.IdbusServerForOperation("DefaultApiService.GetInfo") // Also hard-coded in generated client + if err != nil { + return result, err + } + + ctx := context.WithValue(context.Background(), api.ContextAccessToken, sc.Authn.AccessToken) + req := c.apiClient.DefaultApi.GetInfo(ctx) + req = req.GetServerInfoReq(api.GetServerInfoReq{}) + res, _, err := c.apiClient.DefaultApi.GetInfoExecute(req) + if err != nil { + c.logger.Errorf("GetBundlesReq. Error %v", err) + return result, err + } + + return *res, nil + +} diff --git a/vendor/golang.org/x/crypto/openpgp/packet/config.go b/vendor/golang.org/x/crypto/openpgp/packet/config.go index d770e2c..c76eecc 100644 --- a/vendor/golang.org/x/crypto/openpgp/packet/config.go +++ b/vendor/golang.org/x/crypto/openpgp/packet/config.go @@ -21,7 +21,7 @@ type Config struct { // If zero, SHA-256 is used. DefaultHash crypto.Hash // DefaultCipher is the cipher to be used. - // If zero, AES128 is used. + // If zero, AES-128 is used. DefaultCipher CipherFunction // Time returns the current time as the number of seconds since the // epoch. If Time is nil, time.Now is used. diff --git a/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go b/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go index 2d4e4b8..904b57e 100644 --- a/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go +++ b/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go @@ -29,7 +29,7 @@ import ( // the supplied hash function. // // For example, to use a HMAC-SHA-1 based PBKDF2 key derivation function, you -// can get a derived key for e.g. AES256 (which needs a 32-byte key) by +// can get a derived key for e.g. AES-256 (which needs a 32-byte key) by // doing: // // dk := pbkdf2.Key([]byte("some password"), salt, 4096, 32, sha1.New) diff --git a/vendor/golang.org/x/crypto/scrypt/scrypt.go b/vendor/golang.org/x/crypto/scrypt/scrypt.go index 4cb9cb3..c971a99 100644 --- a/vendor/golang.org/x/crypto/scrypt/scrypt.go +++ b/vendor/golang.org/x/crypto/scrypt/scrypt.go @@ -183,7 +183,7 @@ func smix(b []byte, r, N int, v, xy []uint32) { // r and p must satisfy r * p < 2³⁰. If the parameters do not satisfy the // limits, the function returns a nil byte slice and an error. // -// For example, you can get a derived key for e.g. AES256 (which needs a +// For example, you can get a derived key for e.g. AES-256 (which needs a // 32-byte key) by doing: // // dk, err := scrypt.Key([]byte("some password"), salt, 32768, 8, 1, 32) diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 1adde86..83f112c 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -60,7 +60,7 @@ var X86 struct { HasERMS bool // Enhanced REP for MOVSB and STOSB HasFMA bool // Fused-multiply-add instructions HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers. - HasPCLMULQDQ bool // PCLMULQDQ instruction - most often used for AESGCM + HasPCLMULQDQ bool // PCLMULQDQ instruction - most often used for AES-GCM HasPOPCNT bool // Hamming weight instruction POPCNT. HasRDRAND bool // RDRAND instruction (on-chip random number generator) HasRDSEED bool // RDSEED instruction (on-chip random number generator) diff --git a/vendor/golang.org/x/sys/cpu/cpu_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_s390x.go index 9e3fb5c..5881b88 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_s390x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_s390x.go @@ -88,9 +88,9 @@ type function uint8 const ( // KM{,A,C,CTR} function codes - aes128 function = 18 // AES128 - aes192 function = 19 // AES192 - aes256 function = 20 // AES256 + aes128 function = 18 // AES-128 + aes192 function = 19 // AES-192 + aes256 function = 20 // AES-256 // K{I,L}MD function codes sha1 function = 1 // SHA-1 diff --git a/vendor/modules.txt b/vendor/modules.txt index a3dbd51..235e95c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -12,7 +12,7 @@ github.com/apparentlymart/go-cidr/cidr github.com/apparentlymart/go-textseg/v13/textseg # github.com/armon/go-radix v1.0.0 github.com/armon/go-radix -# github.com/atricore/josso-api-go v0.4.4 +# github.com/atricore/josso-api-go v0.4.4 => ../josso-api-go ## explicit github.com/atricore/josso-api-go # github.com/atricore/josso-sdk-go v0.4.6 => ../josso-sdk-go @@ -349,3 +349,4 @@ google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/emptypb google.golang.org/protobuf/types/known/timestamppb # github.com/atricore/josso-sdk-go => ../josso-sdk-go +# github.com/atricore/josso-api-go => ../josso-api-go