Skip to content
Snippets Groups Projects
Commit 6a6356d3 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Merge branch 'bugfix/70-filter-by-correct-uid-when-listing-buckets' into 'development'

Resolve "Filter by correct UID when listing buckets"

Closes #70

See merge request !67
parents af3845a4 025413b4
No related branches found
No related tags found
2 merge requests!71Delete dev branch,!67Resolve "Filter by correct UID when listing buckets"
Pipeline #40482 passed
......@@ -31,13 +31,13 @@ repos:
files: app
args: [-c]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
rev: v1.7.0
hooks:
- id: mypy
files: app
args: [--config=pyproject.toml]
additional_dependencies:
- boto3-stubs-lite[s3]
- boto3-stubs-lite[s3]>=1.29.0,<1.30.0
- sqlalchemy>=2.0.0,<2.1.0
- pydantic>=2.4.0,<2.5.0
- pydantic>=2.5.0,<2.6.0
- types-requests
......@@ -4,7 +4,7 @@ ENV PORT=8000
RUN pip install --no-cache-dir httpx[cli]
HEALTHCHECK --interval=35s --timeout=4s CMD httpx http://localhost:$PORT/health || exit 1
HEALTHCHECK --interval=30s --timeout=4s CMD httpx http://localhost:$PORT/health || exit 1
COPY ./scripts/prestart.sh /app/prestart.sh
COPY ./requirements.txt /app/requirements.txt
......
......@@ -92,14 +92,14 @@ async def list_buckets(
All the buckets for which the user has READ permissions.
"""
current_span = trace.get_current_span()
if user is not None:
if user is not None: # pragma: no cover
current_span.set_attribute("uid", user)
current_span.set_attribute("bucket_type", bucket_type.name)
await authorization("list_all" if user is None or current_user.uid != user else "list")
if user is None:
buckets = await CRUDBucket.get_all(db)
else:
buckets = await CRUDBucket.get_for_user(db, current_user.uid, bucket_type)
buckets = await CRUDBucket.get_for_user(db, user, bucket_type)
def map_buckets(bucket: Bucket) -> BucketOutSchema:
# define function to fetch objects only one time for each bucket
......
......@@ -7,9 +7,9 @@ coverage[toml]>=7.3.0,<7.4.0
ruff>=0.1.0,<0.2.0
black>=23.11.0,<23.12.0
isort>=5.12.0,<5.13.0
mypy>=1.6.0,<1.7.0
mypy>=1.7.0,<1.8.0
# stubs for mypy
boto3-stubs-lite[s3]>=1.28.0,<1.29.0
boto3-stubs-lite[s3]>=1.29.0,<1.30.0
types-requests
# Miscellaneous
pre-commit>=3.5.0,<3.6.0
......
......@@ -4,8 +4,8 @@ clowmdb>=2.2.0,<2.3.0
# Webserver packages
anyio>=3.7.0,<4.0.0
fastapi>=0.104.0,<0.105.0
pydantic>=2.4.0,<2.5.0
pydantic-settings>=2.0.0,<2.1.0
pydantic>=2.5.0,<2.6.0
pydantic-settings>=2.1.0,<2.2.0
uvicorn>=0.24.0,<0.25.0
# Database packages
PyMySQL>=1.1.0,<1.2.0
......@@ -14,7 +14,7 @@ aiomysql>=0.2.0,<0.3.0
# Security packages
authlib>=1.2.0,<1.3.0
# Ceph and S3 packages
boto3>=1.28.0,<1.29.0
boto3>=1.29.0,<1.30.0
rgwadmin>=2.4.0,<2.5.0
# Miscellaneous
tenacity>=8.2.0,<8.3.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment