Skip to content

Commit f3f809b

Browse files
committed
Separate ResourceRef and ResourceHandle
1 parent 3425d7a commit f3f809b

34 files changed

Lines changed: 10150 additions & 9227 deletions

src/adapter/auth-web3/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ doctest = false
2222

2323

2424
[features]
25-
default = ["did-pkh"]
26-
27-
did-pkh = ["odf/did-pkh"]
25+
default = []
2826

2927

3028
[dependencies]
@@ -54,6 +52,9 @@ kamu-auth-web3-services = { workspace = true, default-features = false }
5452

5553
chrono = { version = "0.4", default-features = false }
5654
indoc = { version = "2" }
57-
pretty_assertions = { version = "1", default-features = false, features = ["std", "unstable"] }
55+
pretty_assertions = { version = "1", default-features = false, features = [
56+
"std",
57+
"unstable",
58+
] }
5859
test-log = { version = "0.2", features = ["trace"] }
5960
tokio = { version = "1", default-features = false, features = [] }

src/adapter/auth-web3/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
// the Business Source License, use of this software will be governed
1717
// by the Apache License, Version 2.0.
1818

19-
#[cfg(not(feature = "did-pkh"))]
20-
compile_error!("Feature `did-pkh` must be enabled for using Web3WalletAuthenticationProvider");
21-
2219
mod dependencies;
2320
mod web3_wallet_authentication_provider;
2421

src/adapter/graphql/src/scalars/account.rs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,6 @@ simple_string_scalar!(AccountName, odf::AccountName);
1919
simple_string_scalar!(Email, email_utils::Email, parse);
2020
simple_string_scalar!(AccountPassword, kamu_accounts::Password, try_new);
2121

22-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
23-
24-
#[derive(Debug, Clone)]
25-
pub struct AccountRef(odf::metadata::auth::AccountRef);
26-
27-
#[Object]
28-
impl AccountRef {
29-
pub async fn id(&self) -> Option<AccountID<'_>> {
30-
self.0.id().map(Into::into)
31-
}
32-
33-
pub async fn name(&self) -> Option<AccountName<'_>> {
34-
self.0.name().map(Into::into)
35-
}
36-
}
37-
38-
impl From<odf::metadata::auth::AccountRef> for AccountRef {
39-
fn from(value: odf::metadata::auth::AccountRef) -> Self {
40-
Self(value)
41-
}
42-
}
43-
44-
impl From<AccountRef> for odf::metadata::auth::AccountRef {
45-
fn from(value: AccountRef) -> Self {
46-
value.0
47-
}
48-
}
49-
50-
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
51-
52-
#[derive(Debug, Clone)]
53-
pub struct AccountHandle(odf::metadata::auth::AccountHandle);
54-
55-
#[Object]
56-
impl AccountHandle {
57-
pub async fn id(&self) -> AccountID<'_> {
58-
AccountID::from(&self.0.id)
59-
}
60-
61-
pub async fn name(&self) -> AccountName<'_> {
62-
AccountName::from(&self.0.name)
63-
}
64-
}
65-
66-
impl From<odf::metadata::auth::AccountHandle> for AccountHandle {
67-
fn from(value: odf::metadata::auth::AccountHandle) -> Self {
68-
Self(value)
69-
}
70-
}
71-
72-
impl From<AccountHandle> for odf::metadata::auth::AccountHandle {
73-
fn from(value: AccountHandle) -> Self {
74-
value.0
75-
}
76-
}
77-
7822
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7923
// AccountDisplayName
8024
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)