queenbee.config package¶
Submodules¶
Module contents¶
- class queenbee.config.Config(*, type: ~typing.Literal['Config'] = 'Config', annotations: ~typing.Dict[str, ~typing.Any] = <factory>, auth: ~typing.List[~queenbee.config.auth.JWTAuth | ~queenbee.config.auth.HeaderAuth] = [], repositories: ~typing.List[~queenbee.config.repositories.RepositoryReference] = [])[source]¶
Bases:
BaseModel- add_auth(auth: JWTAuth | HeaderAuth)[source]¶
add an authentication method for a specific repository domain
- Parameters:
auth (Union[JWTAuth, HeaderAuth]) – An authentication config object
- add_repository(repo: RepositoryReference, force: bool = False)[source]¶
add a repository reference to the config
- Parameters:
repo (RepositoryReference) – a repository source url and its given name in the config
force (bool, optional) – overwrite existing repository reference with the same name if it exsits. Defaults to False.
- Raises:
ValueError – error thrown if the repository reference already exists and is not to be overwritten
- auth: List[JWTAuth | HeaderAuth]¶
- get_auth_header(repository_url: str) Dict[str, str][source]¶
Get auth headers for the given repository url
- Parameters:
repository_url (str) – The url to a repository
- Returns:
an authorization header string (eg: “Bearer some-jwt-token”)
- Return type:
str
- get_repository(name: str) RepositoryReference[source]¶
get a repository reference by name for the config
- Returns:
a repository reference
- Return type:
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- remove_repository(name: str)[source]¶
remove a repository reference from the config
- Parameters:
name (str) – the name of the repository to remove
- repositories: List[RepositoryReference]¶
- type: Literal['Config']¶