예제 #1
0
        /// <summary>
        /// List all rules This method returns an array of all rules that are stored in the backend. This is useful if you want to get a full view of what rules you have currently in place.
        /// </summary>
        /// <exception cref="Ory.Oathkeeper.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="limit">The maximum amount of rules returned. (optional)</param>
        /// <param name="offset">The offset from where to start looking. (optional)</param>
        /// <returns>ApiResponse of List&lt;OathkeeperRule&gt;</returns>
        public Ory.Oathkeeper.Client.Client.ApiResponse <List <OathkeeperRule> > ListRulesWithHttpInfo(long?limit = default(long?), long?offset = default(long?))
        {
            Ory.Oathkeeper.Client.Client.RequestOptions localVarRequestOptions = new Ory.Oathkeeper.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Oathkeeper.Client.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Oathkeeper.Client.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }


            // make the HTTP request
            var localVarResponse = this.Client.Get <List <OathkeeperRule> >("/rules", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ListRules", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #2
0
        /// <summary>
        /// Retrieve a rule Use this method to retrieve a rule from the storage. If it does not exist you will receive a 404 error.
        /// </summary>
        /// <exception cref="Ory.Oathkeeper.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id"></param>
        /// <returns>ApiResponse of OathkeeperRule</returns>
        public Ory.Oathkeeper.Client.Client.ApiResponse <OathkeeperRule> GetRuleWithHttpInfo(string id)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new Ory.Oathkeeper.Client.Client.ApiException(400, "Missing required parameter 'id' when calling ApiApi->GetRule");
            }

            Ory.Oathkeeper.Client.Client.RequestOptions localVarRequestOptions = new Ory.Oathkeeper.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("id", Ory.Oathkeeper.Client.Client.ClientUtils.ParameterToString(id)); // path parameter


            // make the HTTP request
            var localVarResponse = this.Client.Get <OathkeeperRule>("/rules/{id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetRule", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #3
0
        /// <summary>
        /// List all rules This method returns an array of all rules that are stored in the backend. This is useful if you want to get a full view of what rules you have currently in place.
        /// </summary>
        /// <exception cref="Ory.Oathkeeper.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="limit">The maximum amount of rules returned. (optional)</param>
        /// <param name="offset">The offset from where to start looking. (optional)</param>
        /// <returns>Task of ApiResponse (List&lt;OathkeeperRule&gt;)</returns>
        public async System.Threading.Tasks.Task <Ory.Oathkeeper.Client.Client.ApiResponse <List <OathkeeperRule> > > ListRulesAsyncWithHttpInfo(long?limit = default(long?), long?offset = default(long?))
        {
            Ory.Oathkeeper.Client.Client.RequestOptions localVarRequestOptions = new Ory.Oathkeeper.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (limit != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Oathkeeper.Client.Client.ClientUtils.ParameterToMultiMap("", "limit", limit));
            }
            if (offset != null)
            {
                localVarRequestOptions.QueryParameters.Add(Ory.Oathkeeper.Client.Client.ClientUtils.ParameterToMultiMap("", "offset", offset));
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <List <OathkeeperRule> >("/rules", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ListRules", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #4
0
        /// <summary>
        /// Retrieve a rule Use this method to retrieve a rule from the storage. If it does not exist you will receive a 404 error.
        /// </summary>
        /// <exception cref="Ory.Oathkeeper.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id"></param>
        /// <returns>Task of ApiResponse (OathkeeperRule)</returns>
        public async System.Threading.Tasks.Task <Ory.Oathkeeper.Client.Client.ApiResponse <OathkeeperRule> > GetRuleAsyncWithHttpInfo(string id)
        {
            // verify the required parameter 'id' is set
            if (id == null)
            {
                throw new Ory.Oathkeeper.Client.Client.ApiException(400, "Missing required parameter 'id' when calling ApiApi->GetRule");
            }


            Ory.Oathkeeper.Client.Client.RequestOptions localVarRequestOptions = new Ory.Oathkeeper.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            localVarRequestOptions.PathParameters.Add("id", Ory.Oathkeeper.Client.Client.ClientUtils.ParameterToString(id)); // path parameter


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <OathkeeperRule>("/rules/{id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetRule", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #5
0
        /// <summary>
        /// Check readiness status This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well.  If the service supports TLS Edge Termination, this endpoint does not require the &#x60;X-Forwarded-Proto&#x60; header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
        /// </summary>
        /// <exception cref="Ory.Oathkeeper.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of OathkeeperHealthStatus</returns>
        public Ory.Oathkeeper.Client.Client.ApiResponse <OathkeeperHealthStatus> IsInstanceReadyWithHttpInfo()
        {
            Ory.Oathkeeper.Client.Client.RequestOptions localVarRequestOptions = new Ory.Oathkeeper.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }



            // make the HTTP request
            var localVarResponse = this.Client.Get <OathkeeperHealthStatus>("/health/ready", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("IsInstanceReady", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #6
0
        /// <summary>
        /// Lists cryptographic keys This endpoint returns cryptographic keys that are required to, for example, verify signatures of ID Tokens.
        /// </summary>
        /// <exception cref="Ory.Oathkeeper.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of OathkeeperJsonWebKeySet</returns>
        public Ory.Oathkeeper.Client.Client.ApiResponse <OathkeeperJsonWebKeySet> GetWellKnownJSONWebKeysWithHttpInfo()
        {
            Ory.Oathkeeper.Client.Client.RequestOptions localVarRequestOptions = new Ory.Oathkeeper.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = Ory.Oathkeeper.Client.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }



            // make the HTTP request
            var localVarResponse = this.Client.Get <OathkeeperJsonWebKeySet>("/.well-known/jwks.json", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetWellKnownJSONWebKeys", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
예제 #7
0
        /// <summary>
        /// Check readiness status This endpoint returns a 200 status code when the HTTP server is up running and the environment dependencies (e.g. the database) are responsive as well.  If the service supports TLS Edge Termination, this endpoint does not require the &#x60;X-Forwarded-Proto&#x60; header to be set.  Be aware that if you are running multiple nodes of this service, the health status will never refer to the cluster state, only to a single instance.
        /// </summary>
        /// <exception cref="Ory.Oathkeeper.Client.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (OathkeeperHealthStatus)</returns>
        public async System.Threading.Tasks.Task <Ory.Oathkeeper.Client.Client.ApiResponse <OathkeeperHealthStatus> > IsInstanceReadyAsyncWithHttpInfo()
        {
            Ory.Oathkeeper.Client.Client.RequestOptions localVarRequestOptions = new Ory.Oathkeeper.Client.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }



            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <OathkeeperHealthStatus>("/health/ready", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("IsInstanceReady", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }