Skip to content

Commit

Permalink
Add an allow list of keys
Browse files Browse the repository at this point in the history
Signed-off-by: Kemal Akkoyun <[email protected]>
  • Loading branch information
kakkoyun committed May 10, 2024
1 parent 6f14bb1 commit e6a9219
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion projects/fal/src/fal/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ class ContainerImage:
from a Dockerfile.
"""

_known_keys = {"dockerfile_str", "build_env", "build_args"}

@classmethod
def from_dockerfile_str(cls, text: str, **kwargs):
return dict(dockerfile_str=text, **kwargs)
# Check for unknown keys and return them as a dict.
return dict(
dockerfile_str=text,
**{k: v for k, v in kwargs.items() if k in cls._known_keys},
)

@classmethod
def from_dockerfile(cls, path: str, **kwargs):
Expand Down

0 comments on commit e6a9219

Please sign in to comment.