Skip to content

Commit 5b7749d

Browse files
committed
Merge branch 'main' into matt/client-auth-impl
* main: fix(auth): Require EdDSA and fix verification (#232) release: 0.0.14 feat(server): Implement the new Web API (#230)
2 parents 440353c + 06194f4 commit 5b7749d

File tree

27 files changed

+943
-495
lines changed

27 files changed

+943
-495
lines changed

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ objectstore-client = { path = "clients/rust" }
2525
objectstore-server = { path = "objectstore-server" }
2626
objectstore-service = { path = "objectstore-service" }
2727
objectstore-test = { path = "objectstore-test" }
28-
objectstore-types = { path = "objectstore-types", version = "0.0.13" }
28+
objectstore-types = { path = "objectstore-types", version = "0.0.14" }
2929
stresstest = { path = "stresstest" }
3030

3131
anyhow = "1.0.69"

clients/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.0.14
4+
5+
### New Features ✨
6+
7+
- feat(server): Implement the new Web API by @jan-auer in [#230](https://github.com/getsentry/objectstore/pull/230)
8+
39
## 0.0.13
410

511
### Fixes

clients/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "objectstore-client"
3-
version = "0.0.13"
3+
version = "0.0.14"
44
description = "Client SDK for Objectstore, the Sentry object storage platform"
55
readme = "README.md"
66
authors = [

clients/python/src/objectstore_client/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ def session(self, usecase: Usecase, **scopes: str | int | bool) -> Session:
170170
f"{''.join(SCOPE_VALUE_ALLOWED_CHARS)}"
171171
)
172172

173-
formatted = f"{key}.{value}"
173+
formatted = f"{key}={value}"
174174
parts.append(formatted)
175-
scope_str = "/".join(parts)
175+
scope_str = ";".join(parts)
176176

177177
return Session(
178178
self._pool,
@@ -221,7 +221,7 @@ def _make_headers(self) -> dict[str, str]:
221221
return headers
222222

223223
def _make_url(self, key: str | None, full: bool = False) -> str:
224-
relative_path = f"/v1/{self._usecase.name}/{self._scope}/objects/{key or ''}"
224+
relative_path = f"/v1/objects/{self._usecase.name}/{self._scope}/{key or ''}"
225225
path = self._base_path.rstrip("/") + relative_path
226226
if full:
227227
return f"http://{self._pool.host}:{self._pool.port}{path}"

clients/python/tests/test_smoke.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_object_url() -> None:
1414

1515
assert (
1616
session.object_url("foo/bar")
17-
== "http://127.0.0.1:8888/v1/testing/org.12345/project.1337/app_slug.email_app/objects/foo/bar"
17+
== "http://127.0.0.1:8888/v1/objects/testing/org=12345;project=1337;app_slug=email_app/foo/bar"
1818
)
1919

2020

@@ -24,5 +24,5 @@ def test_object_url_with_base_path() -> None:
2424

2525
assert (
2626
session.object_url("foo/bar")
27-
== "http://127.0.0.1:8888/api/prefix/v1/testing/org.12345/project.1337/objects/foo/bar"
27+
== "http://127.0.0.1:8888/api/prefix/v1/objects/testing/org=12345;project=1337/foo/bar"
2828
)

clients/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Client SDK for Objectstore, the Sentry object storage platform"
55
homepage = "https://getsentry.github.io/objectstore/"
66
repository = "https://github.com/getsentry/objectstore"
77
license-file = "../../LICENSE.md"
8-
version = "0.0.13"
8+
version = "0.0.14"
99
edition = "2024"
1010
rust-version = "1.89"
1111
publish = true

clients/rust/src/client.rs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ impl ScopeInner {
237237
pub(crate) fn usecase(&self) -> &Usecase {
238238
&self.usecase
239239
}
240+
241+
fn as_path_segment(&self) -> &str {
242+
if self.scope.is_empty() {
243+
"_"
244+
} else {
245+
&self.scope
246+
}
247+
}
240248
}
241249

242250
impl std::fmt::Display for ScopeInner {
@@ -265,12 +273,12 @@ impl Scope {
265273
}
266274

267275
fn for_organization(usecase: Usecase, organization: u64) -> Self {
268-
let scope = format!("org.{}", organization);
276+
let scope = format!("org={}", organization);
269277
Self(Ok(ScopeInner { usecase, scope }))
270278
}
271279

272280
fn for_project(usecase: Usecase, organization: u64, project: u64) -> Self {
273-
let scope = format!("org.{}/project.{}", organization, project);
281+
let scope = format!("org={};project={}", organization, project);
274282
Self(Ok(ScopeInner { usecase, scope }))
275283
}
276284

@@ -286,10 +294,10 @@ impl Scope {
286294
Self::validate_value(&value)?;
287295

288296
if !inner.scope.is_empty() {
289-
inner.scope.push('/');
297+
inner.scope.push(';');
290298
}
291299
inner.scope.push_str(key);
292-
inner.scope.push('.');
300+
inner.scope.push('=');
293301
inner.scope.push_str(&value);
294302

295303
Ok(inner)
@@ -441,11 +449,10 @@ impl Session {
441449
let mut segments = url.path_segments_mut().unwrap();
442450
segments
443451
.push("v1")
444-
.extend(self.scope.usecase.name.split("/"));
445-
if !self.scope.scope.is_empty() {
446-
segments.extend(self.scope.scope.split("/"));
447-
}
448-
segments.push("objects").extend(object_key.split("/"));
452+
.push("objects")
453+
.push(&self.scope.usecase.name)
454+
.push(self.scope.as_path_segment())
455+
.extend(object_key.split("/"));
449456
drop(segments);
450457

451458
url
@@ -491,7 +498,7 @@ mod tests {
491498

492499
assert_eq!(
493500
session.object_url("foo/bar").to_string(),
494-
"http://127.0.0.1:8888/v1/testing/org.12345/project.1337/app_slug.email_app/objects/foo/bar"
501+
"http://127.0.0.1:8888/v1/objects/testing/org=12345;project=1337;app_slug=email_app/foo/bar"
495502
)
496503
}
497504

@@ -504,7 +511,7 @@ mod tests {
504511

505512
assert_eq!(
506513
session.object_url("foo/bar").to_string(),
507-
"http://127.0.0.1:8888/api/prefix/v1/testing/org.12345/project.1337/objects/foo/bar"
514+
"http://127.0.0.1:8888/api/prefix/v1/objects/testing/org=12345;project=1337/foo/bar"
508515
)
509516
}
510517
}

0 commit comments

Comments
 (0)