Skip to main content

ProxyServerConfig

Struct ProxyServerConfig 

Source
pub struct ProxyServerConfig {
    pub bucket_creds_fetcher: Option<Py<PyAny>>,
    pub cos_map: PyObject,
    pub http_port: Option<u16>,
    pub https_port: Option<u16>,
    pub validator: Option<Py<PyAny>>,
    pub threads: Option<usize>,
    pub verify: Option<bool>,
    pub hmac_keystore: PyObject,
    pub skip_signature_validation: Option<bool>,
    pub hmac_fetcher: Option<Py<PyAny>>,
    pub max_presign_url_usage_attempts: Option<usize>,
    pub server_name: String,
}
Expand description

Configuration object for :pyfunc:object_storage_proxy.start_server.

§Parameters

cos_map: A dictionary mapping bucket names to their respective COS configuration. Each entry should contain the following keys:

  • host: The COS endpoint (e.g., “s3.eu-de.cloud-object-storage.appdomain.cloud”)
  • port: The port number (e.g., 443)
  • api_key/apikey: The API key for the bucket (optional)
  • ttl/time-to-live: The time-to-live for the API key in seconds (optional)

bucket_creds_fetcher: Optional Python async callable that fetches the API key for a bucket. The callable should accept a single argument, the bucket name. It should return a string containing the API key. http_port: The HTTP port to listen on. https_port: The HTTPS port to listen on. validator: Optional Python async callable that validates the request. The callable should accept two arguments, the token and the bucket name. It should return a boolean indicating whether the request is valid. threads: Optional number of threads to use for the server. If not specified, the server will use a single thread.

Fields§

§bucket_creds_fetcher: Option<Py<PyAny>>§cos_map: PyObject§http_port: Option<u16>§https_port: Option<u16>§validator: Option<Py<PyAny>>§threads: Option<usize>§verify: Option<bool>§hmac_keystore: PyObject§skip_signature_validation: Option<bool>§hmac_fetcher: Option<Py<PyAny>>§max_presign_url_usage_attempts: Option<usize>§server_name: String

Implementations§

Source§

impl ProxyServerConfig

Source

pub fn new( cos_map: PyObject, hmac_keystore: Option<PyObject>, bucket_creds_fetcher: Option<PyObject>, http_port: Option<u16>, https_port: Option<u16>, validator: Option<PyObject>, threads: Option<usize>, verify: Option<bool>, skip_signature_validation: Option<bool>, hmac_fetcher: Option<PyObject>, max_presign_url_usage_attempts: Option<usize>, server_name: String, ) -> Self

Source

pub(crate) fn __repr__(&self) -> PyResult<String>

Trait Implementations§

Source§

impl Debug for ProxyServerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProxyServerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'py> IntoPyObject<'py> for ProxyServerConfig

Source§

type Target = ProxyServerConfig

The Python output type
Source§

type Output = Bound<'py, <ProxyServerConfig as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = PyErr

The type returned in the event of a conversion error.
Source§

fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>

Performs the conversion.
Source§

impl PyClass for ProxyServerConfig

Source§

type Frozen = False

Whether the pyclass is frozen. Read more
Source§

impl PyClassImpl for ProxyServerConfig

Source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
Source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
Source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
Source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
Source§

const IS_IMMUTABLE_TYPE: bool = false

#[pyclass(immutable_type)]
Source§

type BaseType = PyAny

Base class
Source§

type ThreadChecker = SendablePyClass<ProxyServerConfig>

This handles following two situations: Read more
Source§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
Source§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
Source§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
Source§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
Source§

fn items_iter() -> PyClassItemsIter

Source§

fn doc(py: Python<'_>) -> PyResult<&'static CStr>

Rendered class doc
Source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

§

fn dict_offset() -> Option<isize>

§

fn weaklist_offset() -> Option<isize>

Source§

impl PyClassNewTextSignature<ProxyServerConfig> for PyClassImplCollector<ProxyServerConfig>

Source§

fn new_text_signature(self) -> Option<&'static str>

Source§

impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a ProxyServerConfig

Source§

type Holder = Option<PyRef<'py, ProxyServerConfig>>

Source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

Source§

impl<'a, 'py> PyFunctionArgument<'a, 'py, false> for &'a mut ProxyServerConfig

Source§

type Holder = Option<PyRefMut<'py, ProxyServerConfig>>

Source§

fn extract( obj: &'a Bound<'py, PyAny>, holder: &'a mut Self::Holder, ) -> PyResult<Self>

Source§

impl PyMethods<ProxyServerConfig> for PyClassImplCollector<ProxyServerConfig>

Source§

fn py_methods(self) -> &'static PyClassItems

Source§

impl PyTypeInfo for ProxyServerConfig

Source§

const NAME: &'static str = "ProxyServerConfig"

Class name.
Source§

const MODULE: Option<&'static str> = ::core::option::Option::None

Module name, if any.
Source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
§

fn type_object(py: Python<'_>) -> Bound<'_, PyType>

Returns the safe abstraction over the type object.
§

fn is_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type or a subclass of this type.
§

fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of this type.
Source§

impl DerefToPyAny for ProxyServerConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

§

fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>

Converts self into an owned Python object, dropping type information.
§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
§

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>

Converts self into a Python object. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
§

impl<T> PyTypeCheck for T
where T: PyTypeInfo,

§

const NAME: &'static str = <T as PyTypeInfo>::NAME

Name of self. This is used in error messages, for example.
§

fn type_check(object: &Bound<'_, PyAny>) -> bool

Checks if object is an instance of Self, which may include a subtype. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> Ungil for T
where T: Send,