Skip to content

Commit

Permalink
Merge pull request hyperledger-archives#1532 from Artemkaaas/feature/…
Browse files Browse the repository at this point in the history
…auth-rule-builder

Updated documentation for AUTH_RULE builder
  • Loading branch information
jovfer authored Mar 14, 2019
2 parents 5f2a1d0 + 0db9784 commit e7359ac
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/src/commands/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ pub mod auth_rule_command {
.add_required_param("constraint", r#"Set of constraints required for execution of an action
{
constraint_id - type of a constraint. Can be either "ROLE" to specify final constraint or "AND"/"OR" to combine constraints.
role - role of a user which satisfy to constrain.
role - role associated value {TRUSTEE: 0, STEWARD: 2, TRUST_ANCHOR: 101, NETWORK_MONITOR: 201, ANY: *}.
sig_count - the number of signatures required to execution action.
need_to_be_owner - if user must be an owner of transaction.
metadata - additional parameters of the constraint.
Expand All @@ -1241,8 +1241,8 @@ pub mod auth_rule_command {
auth_constraints: [<constraint_1>, <constraint_2>]
}
"#)
.add_example(r#"ledger auth-rule txn_type=NYM action=ADD field=role new_value=101 constraint={"sig_count":1,"role":0,"constraint_id":"role","need_to_be_owner":false}"#)
.add_example(r#"ledger auth-rule txn_type=NYM action=EDIT field=role old_value=101 new_value=0 constraint={"sig_count":1,"role":0,"constraint_id":"role","need_to_be_owner":false}"#)
.add_example(r#"ledger auth-rule txn_type=NYM action=ADD field=role new_value=101 constraint="{"sig_count":1,"role":"0","constraint_id":"ROLE","need_to_be_owner":false}""#)
.add_example(r#"ledger auth-rule txn_type=NYM action=EDIT field=role old_value=101 new_value=0 constraint="{"sig_count":1,"role":"0","constraint_id":"ROLE","need_to_be_owner":false}""#)
.finalize()
);

Expand Down
4 changes: 4 additions & 0 deletions libindy/src/api/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,10 @@ pub extern fn indy_get_response_metadata(command_handle: CommandHandle,
/// 'auth_constraints': [<constraint_1>, <constraint_2>]
/// }
///
/// Default ledger auth rules: https://github.com/hyperledger/indy-node/blob/master/docs/source/auth_rules.md
///
/// More about AUTH_RULE request: https://github.com/hyperledger/indy-node/blob/master/docs/source/requests.md#auth_rule
///
/// cb: Callback that takes command result as parameter.
///
/// #Returns
Expand Down
4 changes: 4 additions & 0 deletions wrappers/ios/libindy-pod/Indy/Wrapper/IndyLedger.h
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@
'auth_constraints': [<constraint_1>, <constraint_2>]
}
Default ledger auth rules: https://github.com/hyperledger/indy-node/blob/master/docs/source/auth_rules.md
More about AUTH_RULE request: https://github.com/hyperledger/indy-node/blob/master/docs/source/requests.md#auth_rule
@param completion Callback that takes command result as parameter. Returns request result as json.
*/
+ (void)buildAuthRuleRequestWithSubmitterDid:(NSString *)submitterDid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,11 @@ public static CompletableFuture<String> getResponseMetadata(
* 'constraint_id': "AND" or "OR"
* 'auth_constraints': [[constraint_1], [constraint_2]]
* }
*
* Default ledger auth rules: https://github.com/hyperledger/indy-node/blob/master/docs/source/auth_rules.md
*
* More about AUTH_RULE request: https://github.com/hyperledger/indy-node/blob/master/docs/source/requests.md#auth_rule
*
* @return A future resolving to a request result as json.
* @throws IndyException Thrown if an error occurs when calling the underlying SDK.
*/
Expand Down
5 changes: 5 additions & 0 deletions wrappers/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,11 @@ can be combined by
'auth_constraints': [<constraint_1>, <constraint_2>]
}
```
Default ledger auth rules: https://github.com/hyperledger/indy-node/blob/master/docs/source/auth_rules.md
More about AUTH_RULE request: https://github.com/hyperledger/indy-node/blob/master/docs/source/requests.md#auth_rule
* __->__ `request`: Json
Errors: `Common*`
Expand Down
4 changes: 4 additions & 0 deletions wrappers/python/indy/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,10 @@ async def build_auth_rule_request(submitter_did: str,
'auth_constraints': [<constraint_1>, <constraint_2>]
}
Default ledger auth rules: https://github.com/hyperledger/indy-node/blob/master/docs/source/auth_rules.md
More about AUTH_RULE request: https://github.com/hyperledger/indy-node/blob/master/docs/source/requests.md#auth_rule
:return: Request result as json.
"""

Expand Down

0 comments on commit e7359ac

Please sign in to comment.