1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#[crate::service(name = "auth-delg", dispatch = false, psibase_mod = "crate")]
#[allow(non_snake_case, unused_variables)]
mod service {
use crate::{services::transact::ServiceMethod, AccountNumber, Claim};
/// This is an implementation of the standard auth service interface defined in [SystemService::AuthInterface]
///
/// This action is automatically called by `transact` when an account using this auth service submits a
/// transaction.
///
/// This action forwards verification to the owning account
#[action]
fn checkAuthSys(
flags: u32,
requester: AccountNumber,
sender: AccountNumber,
action: ServiceMethod,
allowedActions: Vec<ServiceMethod>,
claims: Vec<Claim>,
) -> bool {
unimplemented!()
}
/// Gets the owner account of the specified account
#[action]
fn getOwner(account: AccountNumber) -> AccountNumber {
unimplemented!()
}
/// This is an implementation of the standard auth service interface defined in [SystemService::AuthInterface]
///
/// This action is automatically called by `accounts` when an account is configured to use this auth service.
///
/// Verifies that a particular user is allowed to use a particular auth service.
///
/// This action allows any user who has already set an owning account with `AuthDelegate::setOwner`.
#[action]
fn canAuthUserSys(user: AccountNumber) {
unimplemented!()
}
/// Get the accounts this auth service delegates authority to for a sender.
#[action]
fn getDlgsSys(sender: AccountNumber) -> Vec<AccountNumber> {
unimplemented!()
}
/// Check whether a specified set of authorizer accounts are sufficient to authorize sending a
/// transaction from a specified sender.
///
/// * `sender`: The sender account for the transaction potentially being authorized.
/// * `authorizers`: The set of accounts that have already authorized the execution of the transaction.
///
/// Returns:
/// * `true`: If the sender's owner is among the authorizers
/// * `false`: Otherwise
#[action]
fn isAuthSys(sender: AccountNumber, authorizers: Vec<AccountNumber>) -> bool {
unimplemented!()
}
/// Check whether a specified set of rejecter accounts are sufficient to reject (cancel) a
/// transaction from a specified sender.
///
/// * `sender`: The sender account for the transaction potentially being rejected.
/// * `rejecters`: The set of accounts that have already authorized the rejection of the
/// transaction.
///
/// Returns:
/// * `true`: If the sender's owner is among the rejecters
/// * `false`: Otherwise
#[action]
fn isRejectSys(sender: AccountNumber, rejecters: Vec<AccountNumber>) -> bool {
unimplemented!()
}
/// Set the owner of the sender account
///
/// Whenever a sender using this auth service submits a transaction, authorization
/// for the owned account will check authorization for the owner instead.
#[action]
fn setOwner(owner: AccountNumber) {
unimplemented!()
}
/// Create a new account with the specified name, owned by the specified `owner` account.
///
/// Existing accounts will not be modified. If the `requireMatch` flag
/// is set, then the action will fail if the account exists but is not
/// already owned by the specified owner.
#[action]
fn newAccount(name: AccountNumber, owner: AccountNumber, require_match: bool) -> bool {
unimplemented!()
}
}
#[test]
fn verify_schema() {
crate::assert_schema_matches_package::<Wrapper>();
}