MCPcopy
hub / github.com/coderamp-labs/gitingest / create_s3_client

Function create_s3_client

src/server/s3_utils.py:133–146  ·  view source on GitHub ↗

Create and return an S3 client with configuration from environment.

()

Source from the content-addressed store, hash-verified

131
132
133def create_s3_client() -> BaseClient:
134 """Create and return an S3 client with configuration from environment."""
135 config = get_s3_config()
136 # Log S3 client creation (excluding sensitive info)
137 log_config = config.copy()
138 has_credentials = bool(log_config.pop("aws_access_key_id", None) or log_config.pop("aws_secret_access_key", None))
139 logger.debug(
140 "Creating S3 client",
141 extra={
142 "s3_config": log_config,
143 "has_credentials": has_credentials,
144 },
145 )
146 return boto3.client("s3", **config)
147
148
149def upload_to_s3(content: str, s3_file_path: str, ingest_id: UUID) -> str:

Callers 5

upload_to_s3Function · 0.85
upload_metadata_to_s3Function · 0.85
get_metadata_from_s3Function · 0.85
check_s3_object_existsFunction · 0.85
get_s3_url_for_ingest_idFunction · 0.85

Calls 1

get_s3_configFunction · 0.85

Tested by

no test coverage detected