Skip to content

feat: add general access enum to consts #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [1.4.0](../../releases/tag/v1.4.0) - 2025-04-7

### Added

- Added general access enums to consts

## [1.3.2](../../releases/tag/v1.3.2) - 2025-03-20

### Added
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "apify_shared"
version = "1.3.2"
version = "1.4.0"
description = "Tools and constants shared across Apify projects."
readme = "README.md"
license = { text = "Apache Software License" }
Expand Down
30 changes: 27 additions & 3 deletions src/apify_shared/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,34 @@ class MetaOrigin(str, Enum):

STRING_ENV_VARS: list[STRING_ENV_VARS_TYPE] = list(get_args(STRING_ENV_VARS_TYPE))

COMMA_SEPARATED_LIST_ENV_VARS_TYPE = Literal[
ActorEnvVars.BUILD_TAGS,
]
COMMA_SEPARATED_LIST_ENV_VARS_TYPE = Literal[ActorEnvVars.BUILD_TAGS,]

COMMA_SEPARATED_LIST_ENV_VARS: list[COMMA_SEPARATED_LIST_ENV_VARS_TYPE] = list(
get_args(COMMA_SEPARATED_LIST_ENV_VARS_TYPE)
)


class StorageGeneralAccess(str, Enum):
"""Storage setting determining how others can access the storage.

This setting overrides the user setting of the storage owner.
"""

#: Only signed-in users with explicit access can read this storage.
RESTRICTED = 'RESTRICTED'
#: Anyone with a link or the unique storage ID can read this storage.
ANYONE_WITH_ID_CAN_READ = 'ANYONE_WITH_ID_CAN_READ'
#: Anyone with a link, ID, or storage name can read this storage.
ANYONE_WITH_NAME_CAN_READ = 'ANYONE_WITH_NAME_CAN_READ'


class RunGeneralAccess(str, Enum):
"""Run setting determining how others can access the run.

This setting overrides the user setting of the run owner.
"""

#: Only signed-in users with explicit access can read this run.
RESTRICTED = 'RESTRICTED'
#: Anyone with a link or the unique run ID can read this run.
ANYONE_WITH_ID_CAN_READ = 'ANYONE_WITH_ID_CAN_READ'