Skip to content
Merged
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 @@ -5,17 +5,11 @@ meta {
}

get {
url: {{baseUrl}}/api/ui/service-providers/:serviceProviderId/tenants/:tenantId/participants/:participantId
url: {{baseUrl}}/api/ui/service-providers/{{providerId}}/tenants/{{tenant_id}}/participants/{{participant_id}}
body: none
auth: inherit
}

params:path {
serviceProviderId:
tenantId:
participantId:
}

example {
name: 200 Response
description: Successfully retrieved participant details
Expand Down
7 changes: 3 additions & 4 deletions bruno/OpenAPI definition/Redline UI/Get tenant details.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ meta {
}

get {
url: {{baseUrl}}/api/ui/service-providers/:serviceProviderId/tenants/:tenantId
url: {{baseUrl}}/api/ui/service-providers/{{providerId}}/tenants/{{tenant_id}}
body: none
auth: inherit
}

params:path {
serviceProviderId:
tenantId:
vars:pre-request {
baseUrl: http://redline.vps.beardyinc.com
}

example {
Expand Down
16 changes: 16 additions & 0 deletions bruno/OpenAPI definition/Redline UI/List Contracts.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: List Contracts
type: http
seq: 13
}

get {
url: {{baseUrl}}/api/ui/service-providers/{{providerId}}/tenants/{{tenant_id}}/participants/{{participant_id}}/contracts
body: none
auth: inherit
}

settings {
encodeUrl: true
timeout: 0
}
9 changes: 1 addition & 8 deletions bruno/OpenAPI definition/Redline UI/Request catalog.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@ meta {
}

post {
url: {{baseUrl}}/api/ui/service-providers/:providerId/tenants/:tenantId/participants/:participantId/catalog
url: {{baseUrl}}/api/ui/service-providers/{{providerId}}/tenants/{{tenant_id}}/participants/{{participant_id}}/catalog
body: none
auth: inherit
}

params:query {
counterPartyIdentifier:
~cacheControl:
}

params:path {
providerId:
tenantId:
participantId:
}

headers {
~Cache-Control:
}
Expand Down
8 changes: 1 addition & 7 deletions bruno/OpenAPI definition/Redline UI/Upload a file.bru
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ meta {
}

post {
url: {{baseUrl}}/api/ui/service-providers/:providerId/tenants/:tenantId/participants/:participantId/files
url: {{baseUrl}}/api/ui/service-providers/{{providerId}}/tenants/{{tenant_id}}/participants/{{participant_id}}/files
body: multipartForm
auth: inherit
}

params:path {
participantId:
tenantId:
providerId:
}

body:multipart-form {
file:
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package com.metaformsystems.redline.client.management;

import com.metaformsystems.redline.client.management.dto.Catalog;
import com.metaformsystems.redline.client.management.dto.ContractNegotiation;
import com.metaformsystems.redline.client.management.dto.NewAsset;
import com.metaformsystems.redline.client.management.dto.NewCelExpression;
import com.metaformsystems.redline.client.management.dto.NewContractDefinition;
Expand Down Expand Up @@ -69,4 +70,6 @@ public interface ManagementApiClient {
Map<String, String> setupTransfer(String participantContextId, String policyId, String providerId);

List<TransferProcess> listTransferProcesses(String participantContextId);

List<ContractNegotiation> listContracts(String participantContextId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import com.metaformsystems.redline.client.TokenProvider;
import com.metaformsystems.redline.client.management.dto.Catalog;
import com.metaformsystems.redline.client.management.dto.ContractNegotiation;
import com.metaformsystems.redline.client.management.dto.NewAsset;
import com.metaformsystems.redline.client.management.dto.NewCelExpression;
import com.metaformsystems.redline.client.management.dto.NewContractDefinition;
Expand All @@ -27,6 +28,7 @@
import com.metaformsystems.redline.repository.ParticipantRepository;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.client.WebClient;

Expand Down Expand Up @@ -262,6 +264,18 @@ public List<TransferProcess> listTransferProcesses(String participantContextId)
.block();
}

@Override
public List<ContractNegotiation> listContracts(String participantContextId) {
return controlPlaneWebClient.post()
.uri("/v4alpha/participants/{participantContextId}/contractnegotiations/request", participantContextId)
.header("Authorization", "Bearer " + getToken(participantContextId))
.contentType(MediaType.APPLICATION_JSON)
.retrieve()
.bodyToMono(new ParameterizedTypeReference<List<ContractNegotiation>>() {
})
.block();
}

private String getToken(String participantContextId) {
var participantProfile = participantRepository.findByParticipantContextId(participantContextId)
.orElseThrow(() -> new IllegalArgumentException("Participant not found with context id: " + participantContextId));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (c) 2026 Metaform Systems, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Metaform Systems, Inc. - initial API and implementation
*
*/

package com.metaformsystems.redline.client.management.dto;


import java.util.Map;

public class ContractAgreement {
private String id;
private String providerId;
private String consumerId;
private long contractSigningDate;
private String assetId;
private Map<String, Object> policy;
private String participantContextId;
private String agreementId;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getProviderId() {
return providerId;
}

public void setProviderId(String providerId) {
this.providerId = providerId;
}

public String getConsumerId() {
return consumerId;
}

public void setConsumerId(String consumerId) {
this.consumerId = consumerId;
}

public long getContractSigningDate() {
return contractSigningDate;
}

public void setContractSigningDate(long contractSigningDate) {
this.contractSigningDate = contractSigningDate;
}

public String getAssetId() {
return assetId;
}

public void setAssetId(String assetId) {
this.assetId = assetId;
}

public Map<String, Object> getPolicy() {
return policy;
}

public void setPolicy(Map<String, Object> policy) {
this.policy = policy;
}

public String getParticipantContextId() {
return participantContextId;
}

public void setParticipantContextId(String participantContextId) {
this.participantContextId = participantContextId;
}

public String getAgreementId() {
return agreementId;
}

public void setAgreementId(String agreementId) {
this.agreementId = agreementId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (c) 2026 Metaform Systems, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Metaform Systems, Inc. - initial API and implementation
*
*/

package com.metaformsystems.redline.client.management.dto;

import java.util.ArrayList;
import java.util.List;

public class ContractNegotiation {
private String correlationId;
private String counterPartyId;
private String counterPartyAddress;
private String protocol;
private String participantContextId;
private String type = "CONSUMER";
private ContractAgreement contractAgreement;
private List<ContractOffer> contractOffers = new ArrayList<>();

public String getCorrelationId() {
return correlationId;
}

public void setCorrelationId(String correlationId) {
this.correlationId = correlationId;
}

public String getCounterPartyId() {
return counterPartyId;
}

public void setCounterPartyId(String counterPartyId) {
this.counterPartyId = counterPartyId;
}

public String getCounterPartyAddress() {
return counterPartyAddress;
}

public void setCounterPartyAddress(String counterPartyAddress) {
this.counterPartyAddress = counterPartyAddress;
}

public String getProtocol() {
return protocol;
}

public void setProtocol(String protocol) {
this.protocol = protocol;
}

public String getParticipantContextId() {
return participantContextId;
}

public void setParticipantContextId(String participantContextId) {
this.participantContextId = participantContextId;
}

public String getType() {
return type;
}

public void setType(String type) {
this.type = type;
}

public ContractAgreement getContractAgreement() {
return contractAgreement;
}

public void setContractAgreement(ContractAgreement contractAgreement) {
this.contractAgreement = contractAgreement;
}

public List<ContractOffer> getContractOffers() {
return contractOffers;
}

public void setContractOffers(List<ContractOffer> contractOffers) {
this.contractOffers = contractOffers;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (c) 2026 Metaform Systems, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Metaform Systems, Inc. - initial API and implementation
*
*/

package com.metaformsystems.redline.client.management.dto;

import java.util.Map;

public class ContractOffer {
private String id;
private Map<String, Object> policy;
private String assetId;

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public Map<String, Object> getPolicy() {
return policy;
}

public void setPolicy(Map<String, Object> policy) {
this.policy = policy;
}

public String getAssetId() {
return assetId;
}

public void setAssetId(String assetId) {
this.assetId = assetId;
}
}
Loading
Loading