This repository was archived by the owner on Apr 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
main/java/org/hyperledger/fabric_ca/sdk
test/java/org/hyperledger/fabric_ca Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -164,8 +164,8 @@ private JsonObject toJsonObject() {
164
164
for (AttrReq attrReq : attrreqs .values ()) {
165
165
JsonObjectBuilder i = Json .createObjectBuilder ();
166
166
i .add ("name" , attrReq .name );
167
- if (attrReq .require != null ) {
168
- i .add ("require " , attrReq .require );
167
+ if (attrReq .optional != null ) {
168
+ i .add ("optional " , attrReq .optional );
169
169
}
170
170
ab .add (i );
171
171
@@ -206,7 +206,7 @@ public AttrReq addAttrReq(String name) throws InvalidArgumentException {
206
206
207
207
public class AttrReq {
208
208
final String name ;
209
- Boolean require = null ;
209
+ Boolean optional = null ;
210
210
211
211
AttrReq (String name ) {
212
212
this .name = name ;
@@ -216,8 +216,8 @@ public class AttrReq {
216
216
attrreqs .put (name , this );
217
217
}
218
218
219
- public AttrReq setRequire (boolean require ) {
220
- this .require = require ;
219
+ public AttrReq setOptional (boolean optional ) {
220
+ this .optional = optional ;
221
221
return this ;
222
222
}
223
223
}
Original file line number Diff line number Diff line change @@ -123,14 +123,14 @@ public void testEnrollReqToJsonAttr() throws Exception {
123
123
testEnrollReq .setKeyPair (null );
124
124
testEnrollReq .setCAName (caName );
125
125
testEnrollReq .addAttrReq ("foo" );
126
- testEnrollReq .addAttrReq ("foorequired" ).setRequire ( true );
127
- testEnrollReq .addAttrReq ("foofalse" ).setRequire ( false );
126
+ testEnrollReq .addAttrReq ("foorequired" ).setOptional ( false );
127
+ testEnrollReq .addAttrReq ("foofalse" ).setOptional ( true );
128
128
129
129
String s = testEnrollReq .toJson ();
130
130
assertNotNull (s );
131
131
assertTrue (s .contains ("\" attr_reqs\" :[" ));
132
- assertTrue (s .contains ("\" name\" :\" foorequired\" ,\" require \" :true " ));
133
- assertTrue (s .contains ("\" name\" :\" foofalse\" ,\" require \" :false " ));
132
+ assertTrue (s .contains ("\" name\" :\" foorequired\" ,\" optional \" :false " ));
133
+ assertTrue (s .contains ("\" name\" :\" foofalse\" ,\" optional \" :true " ));
134
134
135
135
}
136
136
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public void testRegisterAttributes() throws Exception {
132
132
fail ("Secret returned from RegistrationRequest not match : " + user .getEnrollmentSecret ());
133
133
}
134
134
EnrollmentRequest req = new EnrollmentRequest ();
135
- req .addAttrReq ("testattr2" ).setRequire ( true );
135
+ req .addAttrReq ("testattr2" ).setOptional ( false );
136
136
137
137
user .setEnrollment (client .enroll (user .getName (), user .getEnrollmentSecret (), req ));
138
138
You can’t perform that action at this time.
0 commit comments