Files
chroma/chromadb/utils/__init__.py
Trayan Azarov 48700dd07f [ENH] CIP-2: Auth Providers Proposal (#986)
## Description of changes

*Summarize the changes made by this PR.*
 - New functionality
	 - Auth Provide Client and Server Side Abstractions
	 - Basic Auth Provider

## Test plan
Unit tests for authorized endpoints

## Documentation Changes
Docs should change to describe how to use auth providers on the client
and server. CIP added in `docs/`
2023-08-22 19:48:55 -07:00

13 lines
378 B
Python

import importlib
from typing import Type, TypeVar, cast
C = TypeVar("C")
def get_class(fqn: str, type: Type[C]) -> Type[C]:
"""Given a fully qualifed class name, import the module and return the class"""
module_name, class_name = fqn.rsplit(".", 1)
module = importlib.import_module(module_name)
cls = getattr(module, class_name)
return cast(Type[C], cls)