Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.security.DigestException;
import java.util.*;
import java.util.concurrent.ExecutionException;
import org.cardanofoundation.signify.generated.keria.model.GroupMember;
import org.cardanofoundation.signify.generated.keria.model.Identifier;
import org.cardanofoundation.signify.generated.keria.model.KeyStateRecord;

Expand Down Expand Up @@ -467,12 +468,12 @@ public EventResult rotate(String name, RotateIdentifierArgs kargs) throws Interr
* @param name Name of the group identifier
* @return A list of members of the group
*/
public Object members(String name) throws LibsodiumException, InterruptedException, IOException {
public GroupMember members(String name) throws LibsodiumException, InterruptedException, IOException {
HttpResponse<String> response = this.client.fetch(
"/identifiers/" + name + "/members",
"GET",
null
);
return Utils.fromJson(response.body(), Object.class);
return Utils.fromJson(response.body(), GroupMember.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,50 +44,50 @@
public class MemberEnds {
public static final String JSON_PROPERTY_AGENT = "agent";
@jakarta.annotation.Nullable
private Map<String, String> agent = new HashMap<>();
private Map<String, Object> agent = new HashMap<>();

public static final String JSON_PROPERTY_CONTROLLER = "controller";
@jakarta.annotation.Nullable
private Map<String, String> controller = new HashMap<>();
private Map<String, Object> controller = new HashMap<>();

public static final String JSON_PROPERTY_WITNESS = "witness";
@jakarta.annotation.Nullable
private Map<String, String> witness = new HashMap<>();
private Map<String, Object> witness = new HashMap<>();

public static final String JSON_PROPERTY_REGISTRAR = "registrar";
@jakarta.annotation.Nullable
private Map<String, String> registrar = new HashMap<>();
private Map<String, Object> registrar = new HashMap<>();

public static final String JSON_PROPERTY_WATCHER = "watcher";
@jakarta.annotation.Nullable
private Map<String, String> watcher = new HashMap<>();
private Map<String, Object> watcher = new HashMap<>();

public static final String JSON_PROPERTY_JUDGE = "judge";
@jakarta.annotation.Nullable
private Map<String, String> judge = new HashMap<>();
private Map<String, Object> judge = new HashMap<>();

public static final String JSON_PROPERTY_JUROR = "juror";
@jakarta.annotation.Nullable
private Map<String, String> juror = new HashMap<>();
private Map<String, Object> juror = new HashMap<>();

public static final String JSON_PROPERTY_PEER = "peer";
@jakarta.annotation.Nullable
private Map<String, String> peer = new HashMap<>();
private Map<String, Object> peer = new HashMap<>();

public static final String JSON_PROPERTY_MAILBOX = "mailbox";
@jakarta.annotation.Nullable
private Map<String, String> mailbox = new HashMap<>();
private Map<String, Object> mailbox = new HashMap<>();

public MemberEnds() {
}

public MemberEnds agent(@jakarta.annotation.Nullable Map<String, String> agent) {
public MemberEnds agent(@jakarta.annotation.Nullable Map<String, Object> agent) {

this.agent = agent;
return this;
}

public MemberEnds putAgentItem(String key, String agentItem) {
public MemberEnds putAgentItem(String key, Object agentItem) {
if (this.agent == null) {
this.agent = new HashMap<>();
}
Expand All @@ -103,24 +103,24 @@ public MemberEnds putAgentItem(String key, String agentItem) {
@JsonProperty(value = JSON_PROPERTY_AGENT, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getAgent() {
public Map<String, Object> getAgent() {
return agent;
}


@JsonProperty(value = JSON_PROPERTY_AGENT, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setAgent(@jakarta.annotation.Nullable Map<String, String> agent) {
public void setAgent(@jakarta.annotation.Nullable Map<String, Object> agent) {
this.agent = agent;
}

public MemberEnds controller(@jakarta.annotation.Nullable Map<String, String> controller) {
public MemberEnds controller(@jakarta.annotation.Nullable Map<String, Object> controller) {

this.controller = controller;
return this;
}

public MemberEnds putControllerItem(String key, String controllerItem) {
public MemberEnds putControllerItem(String key, Object controllerItem) {
if (this.controller == null) {
this.controller = new HashMap<>();
}
Expand All @@ -136,24 +136,24 @@ public MemberEnds putControllerItem(String key, String controllerItem) {
@JsonProperty(value = JSON_PROPERTY_CONTROLLER, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getController() {
public Map<String, Object> getController() {
return controller;
}


@JsonProperty(value = JSON_PROPERTY_CONTROLLER, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setController(@jakarta.annotation.Nullable Map<String, String> controller) {
public void setController(@jakarta.annotation.Nullable Map<String, Object> controller) {
this.controller = controller;
}

public MemberEnds witness(@jakarta.annotation.Nullable Map<String, String> witness) {
public MemberEnds witness(@jakarta.annotation.Nullable Map<String, Object> witness) {

this.witness = witness;
return this;
}

public MemberEnds putWitnessItem(String key, String witnessItem) {
public MemberEnds putWitnessItem(String key, Object witnessItem) {
if (this.witness == null) {
this.witness = new HashMap<>();
}
Expand All @@ -169,24 +169,24 @@ public MemberEnds putWitnessItem(String key, String witnessItem) {
@JsonProperty(value = JSON_PROPERTY_WITNESS, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getWitness() {
public Map<String, Object> getWitness() {
return witness;
}


@JsonProperty(value = JSON_PROPERTY_WITNESS, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setWitness(@jakarta.annotation.Nullable Map<String, String> witness) {
public void setWitness(@jakarta.annotation.Nullable Map<String, Object> witness) {
this.witness = witness;
}

public MemberEnds registrar(@jakarta.annotation.Nullable Map<String, String> registrar) {
public MemberEnds registrar(@jakarta.annotation.Nullable Map<String, Object> registrar) {

this.registrar = registrar;
return this;
}

public MemberEnds putRegistrarItem(String key, String registrarItem) {
public MemberEnds putRegistrarItem(String key, Object registrarItem) {
if (this.registrar == null) {
this.registrar = new HashMap<>();
}
Expand All @@ -202,24 +202,24 @@ public MemberEnds putRegistrarItem(String key, String registrarItem) {
@JsonProperty(value = JSON_PROPERTY_REGISTRAR, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getRegistrar() {
public Map<String, Object> getRegistrar() {
return registrar;
}


@JsonProperty(value = JSON_PROPERTY_REGISTRAR, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setRegistrar(@jakarta.annotation.Nullable Map<String, String> registrar) {
public void setRegistrar(@jakarta.annotation.Nullable Map<String, Object> registrar) {
this.registrar = registrar;
}

public MemberEnds watcher(@jakarta.annotation.Nullable Map<String, String> watcher) {
public MemberEnds watcher(@jakarta.annotation.Nullable Map<String, Object> watcher) {

this.watcher = watcher;
return this;
}

public MemberEnds putWatcherItem(String key, String watcherItem) {
public MemberEnds putWatcherItem(String key, Object watcherItem) {
if (this.watcher == null) {
this.watcher = new HashMap<>();
}
Expand All @@ -235,24 +235,24 @@ public MemberEnds putWatcherItem(String key, String watcherItem) {
@JsonProperty(value = JSON_PROPERTY_WATCHER, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getWatcher() {
public Map<String, Object> getWatcher() {
return watcher;
}


@JsonProperty(value = JSON_PROPERTY_WATCHER, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setWatcher(@jakarta.annotation.Nullable Map<String, String> watcher) {
public void setWatcher(@jakarta.annotation.Nullable Map<String, Object> watcher) {
this.watcher = watcher;
}

public MemberEnds judge(@jakarta.annotation.Nullable Map<String, String> judge) {
public MemberEnds judge(@jakarta.annotation.Nullable Map<String, Object> judge) {

this.judge = judge;
return this;
}

public MemberEnds putJudgeItem(String key, String judgeItem) {
public MemberEnds putJudgeItem(String key, Object judgeItem) {
if (this.judge == null) {
this.judge = new HashMap<>();
}
Expand All @@ -268,24 +268,24 @@ public MemberEnds putJudgeItem(String key, String judgeItem) {
@JsonProperty(value = JSON_PROPERTY_JUDGE, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getJudge() {
public Map<String, Object> getJudge() {
return judge;
}


@JsonProperty(value = JSON_PROPERTY_JUDGE, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setJudge(@jakarta.annotation.Nullable Map<String, String> judge) {
public void setJudge(@jakarta.annotation.Nullable Map<String, Object> judge) {
this.judge = judge;
}

public MemberEnds juror(@jakarta.annotation.Nullable Map<String, String> juror) {
public MemberEnds juror(@jakarta.annotation.Nullable Map<String, Object> juror) {

this.juror = juror;
return this;
}

public MemberEnds putJurorItem(String key, String jurorItem) {
public MemberEnds putJurorItem(String key, Object jurorItem) {
if (this.juror == null) {
this.juror = new HashMap<>();
}
Expand All @@ -301,24 +301,24 @@ public MemberEnds putJurorItem(String key, String jurorItem) {
@JsonProperty(value = JSON_PROPERTY_JUROR, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getJuror() {
public Map<String, Object> getJuror() {
return juror;
}


@JsonProperty(value = JSON_PROPERTY_JUROR, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setJuror(@jakarta.annotation.Nullable Map<String, String> juror) {
public void setJuror(@jakarta.annotation.Nullable Map<String, Object> juror) {
this.juror = juror;
}

public MemberEnds peer(@jakarta.annotation.Nullable Map<String, String> peer) {
public MemberEnds peer(@jakarta.annotation.Nullable Map<String, Object> peer) {

this.peer = peer;
return this;
}

public MemberEnds putPeerItem(String key, String peerItem) {
public MemberEnds putPeerItem(String key, Object peerItem) {
if (this.peer == null) {
this.peer = new HashMap<>();
}
Expand All @@ -334,24 +334,24 @@ public MemberEnds putPeerItem(String key, String peerItem) {
@JsonProperty(value = JSON_PROPERTY_PEER, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getPeer() {
public Map<String, Object> getPeer() {
return peer;
}


@JsonProperty(value = JSON_PROPERTY_PEER, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPeer(@jakarta.annotation.Nullable Map<String, String> peer) {
public void setPeer(@jakarta.annotation.Nullable Map<String, Object> peer) {
this.peer = peer;
}

public MemberEnds mailbox(@jakarta.annotation.Nullable Map<String, String> mailbox) {
public MemberEnds mailbox(@jakarta.annotation.Nullable Map<String, Object> mailbox) {

this.mailbox = mailbox;
return this;
}

public MemberEnds putMailboxItem(String key, String mailboxItem) {
public MemberEnds putMailboxItem(String key, Object mailboxItem) {
if (this.mailbox == null) {
this.mailbox = new HashMap<>();
}
Expand All @@ -367,14 +367,14 @@ public MemberEnds putMailboxItem(String key, String mailboxItem) {
@JsonProperty(value = JSON_PROPERTY_MAILBOX, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Map<String, String> getMailbox() {
public Map<String, Object> getMailbox() {
return mailbox;
}


@JsonProperty(value = JSON_PROPERTY_MAILBOX, required = false)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMailbox(@jakarta.annotation.Nullable Map<String, String> mailbox) {
public void setMailbox(@jakarta.annotation.Nullable Map<String, Object> mailbox) {
this.mailbox = mailbox;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import org.cardanofoundation.signify.cesr.Serder;
import org.cardanofoundation.signify.cesr.Siger;
import org.cardanofoundation.signify.cesr.util.Utils;
import org.cardanofoundation.signify.generated.keria.model.AidRecord;
import org.cardanofoundation.signify.generated.keria.model.GroupMember;
import org.cardanofoundation.signify.generated.keria.model.Identifier;
import org.cardanofoundation.signify.core.Eventing;
import org.cardanofoundation.signify.e2e.utils.MultisigUtils.AcceptMultisigInceptArgs;
Expand Down Expand Up @@ -167,11 +169,11 @@ void multisigHolderTest() throws Exception {
// Multisig end role
aid1 = client1.identifiers().get("member1").get();
aid2 = client2.identifiers().get("member2").get();
Object members = client1.identifiers().members("holder");
GroupMember members = client1.identifiers().members("holder");
Identifier ghab1 = client1.identifiers().get("holder").get();
List<Map<String, Object>> signing = (List<Map<String, Object>>) Utils.toMap(members).get("signing");
String eid1 = Utils.toList(Utils.toMap(Utils.toMap(signing.getFirst().get("ends")).get("agent")).keySet()).getFirst();
String eid2 = Utils.toList(Utils.toMap(Utils.toMap(signing.get(1).get("ends")).get("agent")).keySet()).getFirst();
List<AidRecord> signing = members.getSigning();
String eid1 = Utils.toList(signing.get(0).getEnds().getAgent().keySet()).getFirst();
String eid2 = Utils.toList(signing.get(1).getEnds().getAgent().keySet()).getFirst();

System.out.println("Starting multisig end role authorization for agent " + eid1);

Expand Down
Loading
Loading