You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b31dbde
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ci): bump version to 0.58.2, fix ruff format and ty type suppression
- Bump version 0.58.1 → 0.58.2 (patch; src/ modified on this branch)
- Collapse multiline raise in _validation.py to satisfy ruff-format
- Add ty: ignore[invalid-argument-type] suppression on intentional
non-string test inputs in test_validation.py
- Add resource name validation section and @Level shorthand docs to
destination user-guide.md
**Shorthand syntax:**`get_destination` accepts the `ConsumptionLevel` value as an `@`-suffix
166
+
directly in the name string for backward compatibility
167
+
(`"my-dest@provider_subaccount"` is equivalent to passing `level=ConsumptionLevel.PROVIDER_SUBACCOUNT`).
168
+
The `level=` parameter form is the canonical and more explicit usage.
169
+
165
170
- AccessStrategy (applies to subaccount reads):
166
171
- SUBSCRIBER_ONLY: Only subscriber (tenant required)
167
172
- PROVIDER_ONLY: Only provider (no tenant)
@@ -925,6 +930,48 @@ Entries with a `"tenant"` field are treated as subscriber-specific. Entries with
925
930
-`HttpError`: HTTP-related or local store read/write errors with `status_code` and `response_text` when applicable
926
931
-`DestinationCertificateError`: raised when a client certificate cannot be loaded or wired into the HTTP session (unsupported format, wrong/missing KeyStorePassword, malformed content, cert/key mismatch)
927
932
933
+
## Resource Name Validation
934
+
935
+
All public methods that accept a resource `name` parameter validate it against the following grammar before any OAuth token is fetched or HTTP request is sent:
936
+
937
+
```
938
+
[A-Za-z0-9][A-Za-z0-9._\-]{0,199}
939
+
```
940
+
941
+
- The first character must be alphanumeric (prevents `.` / `..` path segments).
942
+
- The remaining characters may be letters, digits, dot (`.`), underscore (`_`), or hyphen (`-`).
943
+
- Maximum length: 200 characters.
944
+
945
+
A `ValueError` is raised immediately for names that do not match — no network call is made:
946
+
947
+
```python
948
+
# Valid names — all accepted
949
+
client.get_destination("my-destination")
950
+
client.get_destination("MyDest.v2")
951
+
client.get_destination("AuditLogV3_Destination")
952
+
953
+
# Invalid names — ValueError raised before any HTTP call
The SDK splits on `@`, validates the base name, and resolves the level automatically. If both the suffix and the `level=` parameter are provided with conflicting values, a `ValueError` is raised.
0 commit comments