modal 1.6.5.dev5__tar.gz → 1.6.5.dev7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/PKG-INFO +1 -1
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_functions.py +6 -1
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_server.py +2 -2
- modal-1.6.5.dev7/modal/cli/_audit_logs.py +163 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/_logs.py +4 -2
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/config.py +0 -2
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/profile.py +2 -3
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/token.py +0 -1
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/workspace.py +71 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/client.py +9 -27
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/client.pyi +11 -44
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cls.py +31 -4
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cls.pyi +8 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/config.py +7 -8
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/mount.py +9 -4
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/mount.pyi +3 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/token_flow.py +0 -1
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal.egg-info/PKG-INFO +1 -1
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal.egg-info/SOURCES.txt +1 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/api_grpc.py +16 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/api_pb2.py +574 -537
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/api_pb2.pyi +187 -3
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/api_pb2_grpc.py +33 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/api_pb2_grpc.pyi +10 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/modal_api_grpc.py +1 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_version/__init__.py +1 -1
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/LICENSE +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/README.md +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/__main__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_audit_logs/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_audit_logs/_rpcs.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_audit_logs/count.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_audit_logs/list.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_billing.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_cluster.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_cluster.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_container_entrypoint.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_environments.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_function_variants.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_grpc_client.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_image.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_ipython.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_load_context.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_location.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_logs.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_logs_manager.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_logs_manager.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_metrics.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_metrics.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_object.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_outbound_policy.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_outbound_policy.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_output/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_output/manager.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_output/pty.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_output/rich.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_output/status.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_partial_function.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_resolver.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_resources.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/asgi.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/container_io_manager.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/container_io_manager.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/execution_context.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/execution_context.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/gpu_memory_snapshot.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/task_lifecycle_manager.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/task_lifecycle_manager.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/telemetry.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/user_code_event_loop.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_runtime/user_code_imports.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_serialization.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_server.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_supports_logs.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_traceback.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_tunnel.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_tunnel.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_type_manager.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/app_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/async_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/auth_token_manager.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/blob_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/browser_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/bytes_io_segment_payload.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/curl_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/deprecation.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/display_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/docker_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/function_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/git_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/grpc_testing.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/grpc_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/hash_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/http_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/idle_countdown.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/jwt_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/logger.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/mount_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/name_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/oauth.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/package_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/pattern_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/proxy_support.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/rand_pb_testing.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/sandbox_fs_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/shell_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_utils/time_utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_vendor/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_vendor/a2wsgi_wsgi.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_vendor/cloudpickle.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_vendor/tblib.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_vendor/version.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_watcher.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/_workspace.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/app.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/app.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/billing.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/billing.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/2023.12.312.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/2023.12.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/2024.04.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/2024.10.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/2025.06.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/2026.10.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/PREVIEW.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/README.md +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/builder/base-images.json +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/call_graph.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/_download.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/_help.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/_stats.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/_suggest.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/_traceback.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/app.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/billing.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/changelog.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/container.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/curl.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/dashboard.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/dict.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/endpoint.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/entry_point.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/environment.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/function.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/image.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/import_refs.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/logo.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/network_file_system.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/queues.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/run.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/secret.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/selector.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/server.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/shell.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/skills.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/utils.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cli/volume.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cloud_bucket_mount.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cloud_bucket_mount.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cluster.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/cluster.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/container_process.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/container_process.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/dict.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/dict.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/environments.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/environments.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/exception.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/_flash_container_entry.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/flash.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/flash.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/flash_server.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/flash_server.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/stream.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/experimental/stream.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/file_pattern_matcher.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/functions.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/functions.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/image.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/image.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/io_streams.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/io_streams.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/network_file_system.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/network_file_system.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/object.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/object.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/output.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/parallel_map.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/parallel_map.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/partial_function.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/partial_function.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/proxy.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/proxy.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/py.typed +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/queue.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/queue.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/retries.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/runner.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/runner.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/running_app.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_common.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_filesystem.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_impl_persistent.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_impl_v1.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_impl_v2.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_sandbox.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_sidecar.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_snapshot.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/_task_command_router_client.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/sandbox.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/sandbox/sandbox.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/schedule.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/scheduler_placement.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/secret.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/secret.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/server.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/server.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/serving.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/serving.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/skills/modal/SKILL.md +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/stream_type.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/token_flow.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/types.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/volume.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/volume.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/workspace.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal/workspace.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal.egg-info/dependency_links.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal.egg-info/entry_points.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal.egg-info/requires.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal.egg-info/top_level.txt +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/gen_cli_docs.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/gen_cli_docs_main.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/gen_reference_docs.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/gen_reference_docs_main.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/mdmd/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/mdmd/mdmd.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/mdmd/signatures.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/mdmd/types.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_docs/reference_intro.md +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/__init__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/py.typed +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/task_command_router_grpc.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2_grpc.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_proto/task_command_router_pb2_grpc.pyi +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/modal_version/__main__.py +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/pyproject.toml +0 -0
- {modal-1.6.5.dev5 → modal-1.6.5.dev7}/setup.cfg +0 -0
|
@@ -965,6 +965,8 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
965
965
|
is_web_endpoint, is_generator, restrict_output
|
|
966
966
|
)
|
|
967
967
|
|
|
968
|
+
class_parameter_info = info.class_parameter_info()
|
|
969
|
+
|
|
968
970
|
async def _preload(
|
|
969
971
|
self: _Function, resolver: Resolver, load_context: LoadContext, existing_object_id: str | None
|
|
970
972
|
):
|
|
@@ -1103,7 +1105,7 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
1103
1105
|
cloud_bucket_mounts=cloud_bucket_mounts_to_proto(cloud_bucket_mounts)[0],
|
|
1104
1106
|
scheduler_placement=scheduler_placement,
|
|
1105
1107
|
is_class=info.is_service_class(),
|
|
1106
|
-
class_parameter_info=
|
|
1108
|
+
class_parameter_info=class_parameter_info,
|
|
1107
1109
|
i6pn_enabled=i6pn_enabled,
|
|
1108
1110
|
schedule=schedule.proto_message if schedule is not None else None,
|
|
1109
1111
|
snapshot_debug=config.get("snapshot_debug"),
|
|
@@ -1234,6 +1236,9 @@ class _Function(typing.Generic[P, ReturnType, OriginalReturnType], _Object, type
|
|
|
1234
1236
|
obj._is_method = False
|
|
1235
1237
|
obj._spec = function_spec # needed for modal shell
|
|
1236
1238
|
obj._webhook_config = webhook_config # only set locally
|
|
1239
|
+
# Set locally so Cls instances created before the App is running bind their
|
|
1240
|
+
# parameters the same way as instances created afterwards
|
|
1241
|
+
obj._class_parameter_info = class_parameter_info
|
|
1237
1242
|
|
|
1238
1243
|
# Used to check whether we should rebuild a modal.Image which uses `run_function`.
|
|
1239
1244
|
gpus: list[str] = gpu if isinstance(gpu, list) else [gpu] if gpu else []
|
|
@@ -28,7 +28,7 @@ from ._utils.deprecation import deprecation_warning
|
|
|
28
28
|
from ._utils.function_utils import normalize_fractional_target_concurrency, validate_target_concurrency
|
|
29
29
|
from ._utils.http_utils import ClientSessionRegistry
|
|
30
30
|
from .client import _Client
|
|
31
|
-
from .cls import
|
|
31
|
+
from .cls import _get_parameters
|
|
32
32
|
from .config import logger
|
|
33
33
|
from .exception import ExecutionError, InvalidError, ServiceError
|
|
34
34
|
from .types import ServerAutoscalerSettings, ServerContainerInfo, ServerInfo, ServerSessionCredentials, ServerStats
|
|
@@ -402,7 +402,7 @@ class _Server:
|
|
|
402
402
|
raise TypeError("The @app.server() decorator must be used on a class.")
|
|
403
403
|
|
|
404
404
|
# Check for modal.parameter() - not allowed on server classes
|
|
405
|
-
params =
|
|
405
|
+
params = _get_parameters(user_cls)
|
|
406
406
|
if params:
|
|
407
407
|
raise InvalidError(
|
|
408
408
|
f"Server class {user_cls.__name__} cannot use modal.parameter(). "
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Copyright Modal Labs 2026
|
|
2
|
+
import contextlib
|
|
3
|
+
import csv
|
|
4
|
+
import io
|
|
5
|
+
import json
|
|
6
|
+
import logging
|
|
7
|
+
from collections.abc import Iterable, Iterator
|
|
8
|
+
from datetime import datetime, timezone
|
|
9
|
+
|
|
10
|
+
import click
|
|
11
|
+
|
|
12
|
+
from modal._utils.logger import logger
|
|
13
|
+
from modal._workspace import _AUDIT_LOG_DEFAULT_WINDOW, _WorkspaceAuditLogsManager
|
|
14
|
+
from modal.types import AuditEvent
|
|
15
|
+
|
|
16
|
+
from ._logs import _parse_fetch_range
|
|
17
|
+
|
|
18
|
+
_CSV_COLUMNS = (
|
|
19
|
+
"id",
|
|
20
|
+
"timestamp",
|
|
21
|
+
"action",
|
|
22
|
+
"status",
|
|
23
|
+
"actor_type",
|
|
24
|
+
"actor_id",
|
|
25
|
+
"actor_name",
|
|
26
|
+
"actor_email",
|
|
27
|
+
"target_type",
|
|
28
|
+
"target_id",
|
|
29
|
+
"workspace_id",
|
|
30
|
+
"environment_id",
|
|
31
|
+
"environment_name",
|
|
32
|
+
"source",
|
|
33
|
+
"ip_address",
|
|
34
|
+
"metadata",
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _timestamp(entry: AuditEvent) -> str:
|
|
39
|
+
return entry.timestamp.astimezone(timezone.utc).isoformat(timespec="milliseconds")
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def _csv_row(entry: AuditEvent) -> list[str | None]:
|
|
43
|
+
target = entry.targets[0] if entry.targets else None
|
|
44
|
+
return [
|
|
45
|
+
entry.id,
|
|
46
|
+
_timestamp(entry),
|
|
47
|
+
entry.action,
|
|
48
|
+
entry.status,
|
|
49
|
+
entry.actor.type,
|
|
50
|
+
entry.actor.id,
|
|
51
|
+
entry.actor.name,
|
|
52
|
+
entry.actor.email,
|
|
53
|
+
target.type if target else None,
|
|
54
|
+
target.id if target else None,
|
|
55
|
+
entry.context.workspace_id,
|
|
56
|
+
entry.context.environment_id,
|
|
57
|
+
entry.context.environment_name,
|
|
58
|
+
entry.context.source,
|
|
59
|
+
str(entry.context.ip_address) if entry.context.ip_address else None,
|
|
60
|
+
json.dumps(entry.metadata),
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _format_json(entry: AuditEvent) -> str:
|
|
65
|
+
return json.dumps(
|
|
66
|
+
{
|
|
67
|
+
"id": entry.id,
|
|
68
|
+
"timestamp": _timestamp(entry),
|
|
69
|
+
"action": entry.action,
|
|
70
|
+
"status": entry.status,
|
|
71
|
+
"actor": {
|
|
72
|
+
"type": entry.actor.type,
|
|
73
|
+
"id": entry.actor.id,
|
|
74
|
+
"name": entry.actor.name,
|
|
75
|
+
"email": entry.actor.email,
|
|
76
|
+
},
|
|
77
|
+
"targets": [{"type": target.type, "id": target.id} for target in entry.targets],
|
|
78
|
+
"context": {
|
|
79
|
+
"workspace_id": entry.context.workspace_id,
|
|
80
|
+
"environment_id": entry.context.environment_id,
|
|
81
|
+
"environment_name": entry.context.environment_name,
|
|
82
|
+
"source": entry.context.source,
|
|
83
|
+
"ip_address": str(entry.context.ip_address) if entry.context.ip_address else None,
|
|
84
|
+
},
|
|
85
|
+
"metadata": entry.metadata,
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _print_csv_row(row: Iterable[str | None]) -> None:
|
|
91
|
+
buffer = io.StringIO(newline="")
|
|
92
|
+
csv.writer(buffer, lineterminator="\n").writerow(row)
|
|
93
|
+
click.echo(buffer.getvalue(), nl=False)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
async def _print_events(
|
|
97
|
+
manager: _WorkspaceAuditLogsManager,
|
|
98
|
+
*,
|
|
99
|
+
query: str,
|
|
100
|
+
since: datetime | None,
|
|
101
|
+
until: datetime,
|
|
102
|
+
limit: int | None,
|
|
103
|
+
as_csv: bool,
|
|
104
|
+
) -> None:
|
|
105
|
+
if as_csv:
|
|
106
|
+
_print_csv_row(_CSV_COLUMNS)
|
|
107
|
+
stream = manager.fetch(query, since=since, until=until, limit=limit)
|
|
108
|
+
try:
|
|
109
|
+
async for entry in stream:
|
|
110
|
+
if as_csv:
|
|
111
|
+
_print_csv_row(_csv_row(entry))
|
|
112
|
+
else:
|
|
113
|
+
click.echo(_format_json(entry))
|
|
114
|
+
finally:
|
|
115
|
+
await stream.aclose()
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class _DropRateLimitWarnings(logging.Filter):
|
|
119
|
+
def filter(self, record: logging.LogRecord) -> bool:
|
|
120
|
+
message = record.getMessage()
|
|
121
|
+
return not ("/AuditLog" in message and "RESOURCE_EXHAUSTED" in message)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@contextlib.contextmanager
|
|
125
|
+
def _quiet_rate_limit_warnings() -> Iterator[None]:
|
|
126
|
+
"""Hides the SDK's per-retry rate limit warnings so they don't interleave with the printed events."""
|
|
127
|
+
log_filter = _DropRateLimitWarnings()
|
|
128
|
+
logger.addFilter(log_filter)
|
|
129
|
+
try:
|
|
130
|
+
yield
|
|
131
|
+
finally:
|
|
132
|
+
logger.removeFilter(log_filter)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
async def run_audit_logs_command(
|
|
136
|
+
manager: _WorkspaceAuditLogsManager,
|
|
137
|
+
*,
|
|
138
|
+
query: str,
|
|
139
|
+
since: str | None,
|
|
140
|
+
until: str | None,
|
|
141
|
+
limit: int | None,
|
|
142
|
+
count_only: bool,
|
|
143
|
+
as_csv: bool,
|
|
144
|
+
) -> None:
|
|
145
|
+
if count_only and as_csv:
|
|
146
|
+
raise click.UsageError("--csv can't be used with --count.")
|
|
147
|
+
if count_only and since is None:
|
|
148
|
+
raise click.UsageError("--since is required with --count.")
|
|
149
|
+
since_dt, until_dt = _parse_fetch_range(since, until, _AUDIT_LOG_DEFAULT_WINDOW)
|
|
150
|
+
|
|
151
|
+
with _quiet_rate_limit_warnings():
|
|
152
|
+
if count_only:
|
|
153
|
+
click.echo(await manager.count(query, since=since_dt, until=until_dt))
|
|
154
|
+
return
|
|
155
|
+
|
|
156
|
+
await _print_events(
|
|
157
|
+
manager,
|
|
158
|
+
query=query,
|
|
159
|
+
since=since_dt if since is not None else None,
|
|
160
|
+
until=until_dt,
|
|
161
|
+
limit=limit,
|
|
162
|
+
as_csv=as_csv,
|
|
163
|
+
)
|
|
@@ -53,7 +53,9 @@ def _validate_logs_args(*, follow: bool, since: str | None, until: str | None, t
|
|
|
53
53
|
raise UsageError(f"--tail value must not exceed {_FETCH_LIMIT}.")
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
def _parse_fetch_range(
|
|
56
|
+
def _parse_fetch_range(
|
|
57
|
+
since: str | None, until: str | None, default_window: timedelta = timedelta(hours=1)
|
|
58
|
+
) -> tuple[datetime, datetime]:
|
|
57
59
|
now = datetime.now(timezone.utc).replace(microsecond=0)
|
|
58
60
|
|
|
59
61
|
def parse_bound(value: str | None, default: datetime, flag: str) -> datetime:
|
|
@@ -70,7 +72,7 @@ def _parse_fetch_range(since: str | None, until: str | None) -> tuple[datetime,
|
|
|
70
72
|
return result
|
|
71
73
|
|
|
72
74
|
until_dt = parse_bound(until, now, "--until")
|
|
73
|
-
since_dt = parse_bound(since, until_dt -
|
|
75
|
+
since_dt = parse_bound(since, until_dt - default_window, "--since")
|
|
74
76
|
if since_dt >= until_dt:
|
|
75
77
|
raise UsageError("--since must be before --until.")
|
|
76
78
|
if since_dt.timestamp() < 0:
|
|
@@ -31,8 +31,6 @@ def show(redact: bool, include_internal: bool, json: bool):
|
|
|
31
31
|
config_dict["token_secret"] = "***"
|
|
32
32
|
if redact and config_dict.get("oauth_refresh_token"):
|
|
33
33
|
config_dict["oauth_refresh_token"] = "***"
|
|
34
|
-
if redact and config_dict.get("oauth_client_secret"):
|
|
35
|
-
config_dict["oauth_client_secret"] = "***"
|
|
36
34
|
if redact and config_dict.get("oauth_jwt_key"):
|
|
37
35
|
config_dict["oauth_jwt_key"] = "***"
|
|
38
36
|
|
|
@@ -39,7 +39,7 @@ async def list_(json: bool = False):
|
|
|
39
39
|
token_secret=config.get("token_secret", profile=profile, use_env=False),
|
|
40
40
|
oauth_refresh_token=config.get("oauth_refresh_token", profile=profile, use_env=False),
|
|
41
41
|
oauth_client_id=config.get("oauth_client_id", profile=profile, use_env=False),
|
|
42
|
-
|
|
42
|
+
oauth_jwt_key=config.get("oauth_jwt_key", profile=profile, use_env=False),
|
|
43
43
|
)
|
|
44
44
|
for profile in profiles
|
|
45
45
|
]
|
|
@@ -51,7 +51,6 @@ async def list_(json: bool = False):
|
|
|
51
51
|
"MODAL_TOKEN_SECRET",
|
|
52
52
|
"MODAL_OAUTH_REFRESH_TOKEN",
|
|
53
53
|
"MODAL_OAUTH_CLIENT_ID",
|
|
54
|
-
"MODAL_OAUTH_CLIENT_SECRET",
|
|
55
54
|
"MODAL_OAUTH_JWT_KEY",
|
|
56
55
|
)
|
|
57
56
|
if any(env_var in os.environ for env_var in credential_env_vars):
|
|
@@ -62,7 +61,7 @@ async def list_(json: bool = False):
|
|
|
62
61
|
token_secret=config.get("token_secret", profile=config_module._profile),
|
|
63
62
|
oauth_refresh_token=config.get("oauth_refresh_token", profile=config_module._profile),
|
|
64
63
|
oauth_client_id=config.get("oauth_client_id", profile=config_module._profile),
|
|
65
|
-
|
|
64
|
+
oauth_jwt_key=config.get("oauth_jwt_key", profile=config_module._profile),
|
|
66
65
|
)
|
|
67
66
|
env_based_workspace = env_based_resp.username
|
|
68
67
|
except AuthError:
|
|
@@ -20,6 +20,7 @@ from modal.output import OutputManager
|
|
|
20
20
|
from modal.workspace import Workspace
|
|
21
21
|
from modal_proto import api_pb2
|
|
22
22
|
|
|
23
|
+
from ._audit_logs import run_audit_logs_command
|
|
23
24
|
from ._help import _MAX_HELP_WIDTH, ModalGroup
|
|
24
25
|
|
|
25
26
|
WORKSPACE_HELP_TEXT = """Interact with the current Modal Workspace.
|
|
@@ -55,6 +56,76 @@ def members_list(json: bool = False):
|
|
|
55
56
|
display_table(["Name", "Email", "Role", "User ID", "Joined", "Last active"], rows, json=json)
|
|
56
57
|
|
|
57
58
|
|
|
59
|
+
@workspace_cli.command("audit-logs", short_help="Show Workspace audit logs as JSON (default) or CSV.")
|
|
60
|
+
@click.option(
|
|
61
|
+
"-q",
|
|
62
|
+
"--query",
|
|
63
|
+
default="",
|
|
64
|
+
help="Filter events with the audit log search syntax. See https://modal.com/docs/guide/audit-logs#filtering",
|
|
65
|
+
)
|
|
66
|
+
@click.option(
|
|
67
|
+
"--since",
|
|
68
|
+
default=None,
|
|
69
|
+
help="Start of time range. Accepts ISO 8601 datetime or relative time, e.g. '1d' (1 day ago), '2h', '30m'.",
|
|
70
|
+
)
|
|
71
|
+
@click.option("--until", default=None, help="End of time range; accepts same argument types as --since.")
|
|
72
|
+
@click.option(
|
|
73
|
+
"-n",
|
|
74
|
+
"--limit",
|
|
75
|
+
type=int,
|
|
76
|
+
default=None,
|
|
77
|
+
help="Show the newest N events in the range.",
|
|
78
|
+
)
|
|
79
|
+
@click.option(
|
|
80
|
+
"--count", "count_only", is_flag=True, default=False, help="Print the number of matching events; requires --since."
|
|
81
|
+
)
|
|
82
|
+
@click.option("--csv", "as_csv", is_flag=True, default=False, help="Output CSV instead of newline-delimited JSON.")
|
|
83
|
+
@synchronizer.create_blocking
|
|
84
|
+
async def audit_logs(
|
|
85
|
+
query: str = "",
|
|
86
|
+
since: str | None = None,
|
|
87
|
+
until: str | None = None,
|
|
88
|
+
limit: int | None = None,
|
|
89
|
+
count_only: bool = False,
|
|
90
|
+
as_csv: bool = False,
|
|
91
|
+
):
|
|
92
|
+
"""Show the audit logs of the current Workspace as newline-delimited JSON (default) or CSV.
|
|
93
|
+
|
|
94
|
+
By default, this command prints the newest 100 events from the last 7 days. With ``--since``, it
|
|
95
|
+
prints every event in the range, oldest first. The range cannot exceed 7 days.
|
|
96
|
+
|
|
97
|
+
Each line contains a full event, including metadata, with a UTC timestamp at millisecond precision.
|
|
98
|
+
|
|
99
|
+
Counting with ``--count`` requires ``--since`` to specify the start of the time range.
|
|
100
|
+
|
|
101
|
+
Examples:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Newest 100 events
|
|
105
|
+
modal workspace audit-logs
|
|
106
|
+
|
|
107
|
+
# Every deploy or stop in the last 2 days
|
|
108
|
+
modal workspace audit-logs -q 'action:(app.deploy OR app.stop)' --since 2d
|
|
109
|
+
|
|
110
|
+
# Every field of each event, one JSON object per line
|
|
111
|
+
modal workspace audit-logs --since 1d
|
|
112
|
+
|
|
113
|
+
# Export every event in the last day as CSV
|
|
114
|
+
modal workspace audit-logs --since 1d --csv > audit.csv
|
|
115
|
+
|
|
116
|
+
# How many secrets were created in the last 7 days
|
|
117
|
+
modal workspace audit-logs -q 'action:secret.create' --since 7d --count
|
|
118
|
+
```
|
|
119
|
+
"""
|
|
120
|
+
if limit is not None and limit < 1:
|
|
121
|
+
raise click.BadParameter("must be at least 1", param_hint="'--limit'")
|
|
122
|
+
ws = _Workspace.from_context()
|
|
123
|
+
await ws.hydrate()
|
|
124
|
+
await run_audit_logs_command(
|
|
125
|
+
ws.audit_logs, query=query, since=since, until=until, limit=limit, count_only=count_only, as_csv=as_csv
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
|
|
58
129
|
PROXY_TOKENS_HELP_TEXT = """Manage the proxy tokens of the current Workspace.
|
|
59
130
|
|
|
60
131
|
Proxy tokens provide authentication to Modal Endpoints, Servers, and Web Functions.
|
|
@@ -35,8 +35,7 @@ HEARTBEAT_TIMEOUT: float = HEARTBEAT_INTERVAL + 0.1
|
|
|
35
35
|
class _OAuthCredentials:
|
|
36
36
|
refresh_token: str = field(repr=False)
|
|
37
37
|
client_id: str
|
|
38
|
-
|
|
39
|
-
jwt_key: str | None = field(default=None, repr=False)
|
|
38
|
+
jwt_key: str = field(repr=False)
|
|
40
39
|
|
|
41
40
|
|
|
42
41
|
def _get_metadata(
|
|
@@ -78,8 +77,6 @@ def _get_metadata(
|
|
|
78
77
|
"x-modal-oauth-client-id": oauth_credentials.client_id,
|
|
79
78
|
}
|
|
80
79
|
)
|
|
81
|
-
if oauth_credentials.client_secret:
|
|
82
|
-
metadata["x-modal-oauth-client-secret"] = oauth_credentials.client_secret
|
|
83
80
|
if agent_env := _agent_environment():
|
|
84
81
|
metadata["x-modal-agent-harness"] = urllib.parse.quote(agent_env)
|
|
85
82
|
|
|
@@ -223,7 +220,7 @@ class _Client:
|
|
|
223
220
|
self._cancellation_context_event_loop = asyncio.get_running_loop()
|
|
224
221
|
await self._cancellation_context.__aenter__()
|
|
225
222
|
metadata_provider = None
|
|
226
|
-
if self._oauth_credentials
|
|
223
|
+
if self._oauth_credentials:
|
|
227
224
|
from ._utils.oauth import OAuthAssertionProvider
|
|
228
225
|
|
|
229
226
|
metadata_provider = OAuthAssertionProvider(
|
|
@@ -345,7 +342,6 @@ class _Client:
|
|
|
345
342
|
token_secret = c["token_secret"]
|
|
346
343
|
oauth_refresh_token = c.get("oauth_refresh_token")
|
|
347
344
|
oauth_client_id = c.get("oauth_client_id")
|
|
348
|
-
oauth_client_secret = c.get("oauth_client_secret")
|
|
349
345
|
oauth_jwt_key = c.get("oauth_jwt_key")
|
|
350
346
|
if _is_remote():
|
|
351
347
|
ignored_credential_settings = [
|
|
@@ -355,7 +351,6 @@ class _Client:
|
|
|
355
351
|
("MODAL_TOKEN_SECRET", token_secret),
|
|
356
352
|
("MODAL_OAUTH_REFRESH_TOKEN", oauth_refresh_token),
|
|
357
353
|
("MODAL_OAUTH_CLIENT_ID", oauth_client_id),
|
|
358
|
-
("MODAL_OAUTH_CLIENT_SECRET", oauth_client_secret),
|
|
359
354
|
("MODAL_OAUTH_JWT_KEY", oauth_jwt_key),
|
|
360
355
|
)
|
|
361
356
|
if value
|
|
@@ -370,25 +365,17 @@ class _Client:
|
|
|
370
365
|
oauth_credentials = None
|
|
371
366
|
else:
|
|
372
367
|
has_token_config = bool(token_id or token_secret)
|
|
373
|
-
has_oauth_config = bool(oauth_refresh_token or oauth_client_id or
|
|
368
|
+
has_oauth_config = bool(oauth_refresh_token or oauth_client_id or oauth_jwt_key)
|
|
374
369
|
if has_token_config and has_oauth_config:
|
|
375
370
|
raise InvalidError("Modal token credentials and OAuth credentials cannot both be configured.")
|
|
376
371
|
if has_oauth_config:
|
|
377
|
-
if
|
|
378
|
-
|
|
379
|
-
or not oauth_client_id
|
|
380
|
-
or bool(oauth_client_secret) == bool(oauth_jwt_key)
|
|
381
|
-
):
|
|
382
|
-
raise InvalidError(
|
|
383
|
-
"OAuth refresh token, client ID, and exactly one of client secret or JWT key "
|
|
384
|
-
"must be configured."
|
|
385
|
-
)
|
|
372
|
+
if not oauth_refresh_token or not oauth_client_id or not oauth_jwt_key:
|
|
373
|
+
raise InvalidError("OAuth refresh token, client ID, and JWT key must be configured.")
|
|
386
374
|
client_type = api_pb2.CLIENT_TYPE_CLIENT
|
|
387
375
|
credentials = None
|
|
388
376
|
oauth_credentials = _OAuthCredentials(
|
|
389
377
|
refresh_token=oauth_refresh_token,
|
|
390
378
|
client_id=oauth_client_id,
|
|
391
|
-
client_secret=oauth_client_secret,
|
|
392
379
|
jwt_key=oauth_jwt_key,
|
|
393
380
|
)
|
|
394
381
|
elif token_id and token_secret:
|
|
@@ -458,8 +445,7 @@ class _Client:
|
|
|
458
445
|
refresh_token: str,
|
|
459
446
|
*,
|
|
460
447
|
oauth_client_id: str,
|
|
461
|
-
|
|
462
|
-
oauth_jwt_key: str | None = None,
|
|
448
|
+
oauth_jwt_key: str,
|
|
463
449
|
) -> "_Client":
|
|
464
450
|
"""
|
|
465
451
|
Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
@@ -467,7 +453,6 @@ class _Client:
|
|
|
467
453
|
Args:
|
|
468
454
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
469
455
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
470
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
471
456
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
472
457
|
Requires `modal[oauth]`.
|
|
473
458
|
|
|
@@ -479,24 +464,21 @@ class _Client:
|
|
|
479
464
|
client = modal.Client.from_oauth_credentials(
|
|
480
465
|
refresh_token,
|
|
481
466
|
oauth_client_id=oauth_client_id,
|
|
482
|
-
|
|
467
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
483
468
|
)
|
|
484
469
|
|
|
485
470
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
486
471
|
```
|
|
487
472
|
"""
|
|
488
473
|
_check_config()
|
|
489
|
-
if not refresh_token or not oauth_client_id or
|
|
490
|
-
raise AuthError(
|
|
491
|
-
"OAuth refresh token, client ID, and exactly one of client secret or JWT key must be provided."
|
|
492
|
-
)
|
|
474
|
+
if not refresh_token or not oauth_client_id or not oauth_jwt_key:
|
|
475
|
+
raise AuthError("OAuth refresh token, client ID, and JWT key must be provided.")
|
|
493
476
|
|
|
494
477
|
server_url = config["server_url"]
|
|
495
478
|
client_type = api_pb2.CLIENT_TYPE_CLIENT
|
|
496
479
|
oauth_credentials = _OAuthCredentials(
|
|
497
480
|
refresh_token=refresh_token,
|
|
498
481
|
client_id=oauth_client_id,
|
|
499
|
-
client_secret=oauth_client_secret,
|
|
500
482
|
jwt_key=oauth_jwt_key,
|
|
501
483
|
)
|
|
502
484
|
client = _Client(
|
|
@@ -11,20 +11,13 @@ import typing
|
|
|
11
11
|
import typing_extensions
|
|
12
12
|
|
|
13
13
|
class _OAuthCredentials:
|
|
14
|
-
"""_OAuthCredentials(refresh_token: str, client_id: str,
|
|
14
|
+
"""_OAuthCredentials(refresh_token: str, client_id: str, jwt_key: str)"""
|
|
15
15
|
|
|
16
16
|
refresh_token: str
|
|
17
17
|
client_id: str
|
|
18
|
-
|
|
19
|
-
jwt_key: typing.Optional[str]
|
|
18
|
+
jwt_key: str
|
|
20
19
|
|
|
21
|
-
def __init__(
|
|
22
|
-
self,
|
|
23
|
-
refresh_token: str,
|
|
24
|
-
client_id: str,
|
|
25
|
-
client_secret: typing.Optional[str] = None,
|
|
26
|
-
jwt_key: typing.Optional[str] = None,
|
|
27
|
-
) -> None:
|
|
20
|
+
def __init__(self, refresh_token: str, client_id: str, jwt_key: str) -> None:
|
|
28
21
|
"""Initialize self. See help(type(self)) for accurate signature."""
|
|
29
22
|
...
|
|
30
23
|
|
|
@@ -85,7 +78,7 @@ class _Client:
|
|
|
85
78
|
server_url: str,
|
|
86
79
|
client_type: int,
|
|
87
80
|
credentials: typing.Optional[tuple[str, str]],
|
|
88
|
-
version: str = "1.6.5.
|
|
81
|
+
version: str = "1.6.5.dev7",
|
|
89
82
|
*,
|
|
90
83
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
91
84
|
):
|
|
@@ -203,20 +196,12 @@ class _Client:
|
|
|
203
196
|
...
|
|
204
197
|
|
|
205
198
|
@classmethod
|
|
206
|
-
async def from_oauth_credentials(
|
|
207
|
-
cls,
|
|
208
|
-
refresh_token: str,
|
|
209
|
-
*,
|
|
210
|
-
oauth_client_id: str,
|
|
211
|
-
oauth_client_secret: typing.Optional[str] = None,
|
|
212
|
-
oauth_jwt_key: typing.Optional[str] = None,
|
|
213
|
-
) -> _Client:
|
|
199
|
+
async def from_oauth_credentials(cls, refresh_token: str, *, oauth_client_id: str, oauth_jwt_key: str) -> _Client:
|
|
214
200
|
"""Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
215
201
|
|
|
216
202
|
Args:
|
|
217
203
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
218
204
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
219
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
220
205
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
221
206
|
Requires `modal[oauth]`.
|
|
222
207
|
|
|
@@ -228,7 +213,7 @@ class _Client:
|
|
|
228
213
|
client = modal.Client.from_oauth_credentials(
|
|
229
214
|
refresh_token,
|
|
230
215
|
oauth_client_id=oauth_client_id,
|
|
231
|
-
|
|
216
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
232
217
|
)
|
|
233
218
|
|
|
234
219
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
@@ -310,7 +295,7 @@ class Client:
|
|
|
310
295
|
server_url: str,
|
|
311
296
|
client_type: int,
|
|
312
297
|
credentials: typing.Optional[tuple[str, str]],
|
|
313
|
-
version: str = "1.6.5.
|
|
298
|
+
version: str = "1.6.5.dev7",
|
|
314
299
|
*,
|
|
315
300
|
oauth_credentials: typing.Optional[_OAuthCredentials] = None,
|
|
316
301
|
):
|
|
@@ -535,21 +520,12 @@ class Client:
|
|
|
535
520
|
from_credentials: typing.ClassVar[__from_credentials_spec]
|
|
536
521
|
|
|
537
522
|
class __from_oauth_credentials_spec(typing_extensions.Protocol):
|
|
538
|
-
def __call__(
|
|
539
|
-
self,
|
|
540
|
-
/,
|
|
541
|
-
refresh_token: str,
|
|
542
|
-
*,
|
|
543
|
-
oauth_client_id: str,
|
|
544
|
-
oauth_client_secret: typing.Optional[str] = None,
|
|
545
|
-
oauth_jwt_key: typing.Optional[str] = None,
|
|
546
|
-
) -> Client:
|
|
523
|
+
def __call__(self, /, refresh_token: str, *, oauth_client_id: str, oauth_jwt_key: str) -> Client:
|
|
547
524
|
"""Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
548
525
|
|
|
549
526
|
Args:
|
|
550
527
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
551
528
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
552
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
553
529
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
554
530
|
Requires `modal[oauth]`.
|
|
555
531
|
|
|
@@ -561,7 +537,7 @@ class Client:
|
|
|
561
537
|
client = modal.Client.from_oauth_credentials(
|
|
562
538
|
refresh_token,
|
|
563
539
|
oauth_client_id=oauth_client_id,
|
|
564
|
-
|
|
540
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
565
541
|
)
|
|
566
542
|
|
|
567
543
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|
|
@@ -569,21 +545,12 @@ class Client:
|
|
|
569
545
|
"""
|
|
570
546
|
...
|
|
571
547
|
|
|
572
|
-
async def aio(
|
|
573
|
-
self,
|
|
574
|
-
/,
|
|
575
|
-
refresh_token: str,
|
|
576
|
-
*,
|
|
577
|
-
oauth_client_id: str,
|
|
578
|
-
oauth_client_secret: typing.Optional[str] = None,
|
|
579
|
-
oauth_jwt_key: typing.Optional[str] = None,
|
|
580
|
-
) -> Client:
|
|
548
|
+
async def aio(self, /, refresh_token: str, *, oauth_client_id: str, oauth_jwt_key: str) -> Client:
|
|
581
549
|
"""Constructor based on OAuth credentials; useful for managing Modal on behalf of third-party users.
|
|
582
550
|
|
|
583
551
|
Args:
|
|
584
552
|
refresh_token: OAuth refresh token returned by Modal's token endpoint.
|
|
585
553
|
oauth_client_id: Modal-issued OAuth client ID, with an `oc-` prefix.
|
|
586
|
-
oauth_client_secret: Modal-issued OAuth client secret, with an `ov-` prefix.
|
|
587
554
|
oauth_jwt_key: Unencrypted RSA private key encoded as PEM, with literal or escaped newlines.
|
|
588
555
|
Requires `modal[oauth]`.
|
|
589
556
|
|
|
@@ -595,7 +562,7 @@ class Client:
|
|
|
595
562
|
client = modal.Client.from_oauth_credentials(
|
|
596
563
|
refresh_token,
|
|
597
564
|
oauth_client_id=oauth_client_id,
|
|
598
|
-
|
|
565
|
+
oauth_jwt_key=oauth_jwt_key,
|
|
599
566
|
)
|
|
600
567
|
|
|
601
568
|
modal.Sandbox.create("echo", "hi", client=client, app=app)
|