Skip to content
Concepts and architecture

Concepts and architecture

Riversoft® STCP DirectLink is Riversoft’s managed file transfer (MFT) product for people, systems and partners:

  • People: web portal, in the browser.
  • Systems: REST API.
  • Partners: SFTP, AS2 and Webhook.
  • Other destinations: WhatsApp and cloud storage (Amazon S3, Azure Blob Storage, Google Cloud Storage and Oracle Cloud Object Storage).

For exchanges over the OFTP protocol, use Riversoft STCP Gemini. Both products can be used together or separately and share management through the Riversoft Console Portal and the mailboxes.

Architecture

Riversoft STCP Gemini and Riversoft STCP DirectLink are independent products that can be used together or separately. Both are configured and monitored through the Riversoft Console Portal and the Riversoft STCP Gemini API, and the configuration, records and transfer history are kept in your company’s database.

    flowchart LR
    ADM[Administrator] -->|HTTPS| PORTAL[Riversoft Console Portal]
    SIS[External systems] -->|HTTPS / REST| API[Riversoft STCP Gemini API]
    PORTAL --> API
    API --> DB[(Configuration database<br/>and log database)]
    SRV[Riversoft STCP Gemini Server] --> DB
    DL[Riversoft STCP DirectLink] --> DB
    REN[Riversoft STCP Gemini Rename] --> DB
    SRV <-->|OFTP| PARC[Partners]
    DL <-->|SFTP, AS2, HTTPS, Webhook,<br/>S3, Azure Blob, GCS, OCI| PARC
    SRV -->|events| REN
  
PartRole
TransferRiversoft STCP Gemini Server exchanges files with partners over OFTP; Riversoft STCP DirectLink, over the other protocols and connectors.
ManagementThe Riversoft Console Portal and the Riversoft STCP Gemini API create and change instances, users, network services and schedules, and track transfers.
DatabaseHolds the configuration (configuration database) and the transfer history (log database).
MailboxesEach user’s directories, holding the files to send and the received ones. See Mailbox and directories.
AutomationRiversoft STCP Gemini Rename and the built-in routing of Riversoft STCP DirectLink forward files according to the rules.

Components

ComponentRolePackage
Riversoft STCP DirectLinkTransfers files over every protocol and connector other than OFTP and provides the REST API (/directlink/v2), documented in Riversoft STCP DirectLink API.stcpdirectlink
Riversoft STCP DirectLink PortalWeb interface for signing in, uploading and downloading files. See Using Riversoft STCP DirectLink Portal.stcpdirectlink-portal
Riversoft Console PortalWeb interface for configuring and monitoring Riversoft STCP DirectLink and Riversoft STCP Gemini. It is served by the Riversoft STCP Gemini API.stcpgemini-portal
Riversoft STCP Gemini APIManagement REST API for Riversoft STCP DirectLink and Riversoft STCP Gemini. See Riversoft STCP Gemini API.stcpgemini-api
Riversoft STCP Gemini Rename (optional)File routing and automation. See Riversoft STCP Gemini Rename.stcpren
Riversoft STCP Gemini (optional)Transfers over the OFTP protocol. See Riversoft STCP Gemini.stcpgemini-server
Riversoft STCP Enterprise Server (optional)On Windows, holds users, credentials, rules and file areas.—
Identity provider (optional)Google, Microsoft, Apple or another OAuth 2.0 and 2.1/OpenID Connect or SAML 2.0 provider used for SSO.—
Cloudflare Turnstile (optional)Anti-automation challenge on sign-in, first access and password recovery.—

Protocols and connectors

Riversoft STCP DirectLink serves people, systems and partners, each through the most suitable channel:

    flowchart LR
    U[User in the browser] -->|HTTPS| P[Riversoft STCP DirectLink Portal]
    S[Integrated system] -->|HTTPS / REST API| A[Riversoft STCP DirectLink]
    PS[Service portal] -->|JWT token exchange| A
    IdP[Identity provider] -.->|SSO OAuth 2.0 / SAML 2.0| A
    P --> A
    PARC[Partners] <-->|SFTP, AS2, Webhook| A
    A <-->|S3, Azure, GCS, OCI| N[Cloud storage]
    A -.->|email, SMS, WhatsApp| D[External recipient]
    G[Riversoft Console Portal and<br/>Riversoft STCP Gemini API] -->|configure and monitor| A
  
WhoHow they accessDirection
PeopleRiversoft STCP DirectLink Portal, in the browser, with sign-in, SSO and MFA.Send and receive
Company systemsREST API, with a Bearer token or token exchange.Send and receive
PartnersSFTP, AS2 or Webhook, with Riversoft STCP DirectLink as the server.Send and receive
Partner servers and cloudOutbound connectors: SFTP, AS2, FTPS/FTP, Webhook, WhatsApp, Amazon S3, Azure Blob Storage, Google Cloud Storage and Oracle Cloud Object Storage.Send and collect
External recipientsSecure link sent by email, SMS or WhatsApp, protected by a security code.Receive

The table below shows which product handles each protocol or connector. Details are in Protocols and connectors.

Connector / protocolServerClientProduct
OFTP 1.x and OFTP 2.0✓✓Riversoft STCP Gemini
SFTP✓✓Riversoft STCP DirectLink (legacy client also in Riversoft STCP Gemini Server)
AS2✓✓Riversoft STCP DirectLink
HTTPS (web portal and REST API)✓—Riversoft STCP DirectLink
Webhook✓✓Riversoft STCP DirectLink
WhatsApp—✓Riversoft STCP DirectLink
FTPS / FTP—✓Riversoft STCP DirectLink
Amazon S3, Azure Blob Storage, Google Cloud Storage, Oracle Cloud Object Storage—✓Riversoft STCP DirectLink

Note

Other connectors may be available depending on the version and configuration. See Riversoft STCP DirectLink protocols and connectors.

How a transfer works

Sending and receiving through the API

Protected routes require a Bearer token. The password is presented only once, when obtaining the token.

    sequenceDiagram
    autonumber
    participant App as Client application
    participant DL as Riversoft STCP DirectLink API
    App->>DL: POST /oauth2/token (password grant or token exchange)
    DL-->>App: access_token (Bearer)
    App->>DL: POST /upload (Authorization: Bearer)
    DL-->>App: Upload confirmed
    App->>DL: GET /download/list (Authorization: Bearer)
    DL-->>App: File list with linkURL (secure link)
    App->>DL: GET linkURL (/download/file?...) with Bearer token
    DL-->>App: File content and X-STCPDIRECTLINK-HASH header
    Note over DL: The file moves to the backup area
  

Where an uploaded file goes depends on what is provided in the upload:

UploadFile destination
No destination or recipientThe entrada directory of the user’s own mailbox.
With a destination user (X-STCPDIRECTLINK-DESTINATION header)The saida directory of the destination user’s mailbox, who then sees it in the download area.
With a recipient’s email or mobile numberThe user’s secure link area (saida/link); the recipient receives the link. See Secure link.

The download list shows the files in the saida directory. After the download, the file is moved to the backup area (saida/backup).

Secure link for external recipients

When sending a file, you can provide a recipient’s email address or mobile number. The recipient receives a secure link for download, which identifies the email address or mobile number linked to the file and only releases the download with a security code (PIN).

    sequenceDiagram
    autonumber
    participant R as Sender
    participant DL as Riversoft STCP DirectLink
    participant D as Recipient
    R->>DL: Upload with the recipient's email or mobile number
    DL->>D: Secure link (email, SMS or WhatsApp)
    D->>DL: Opens the link
    DL->>D: Security code (only to the linked email or mobile number)
    D->>DL: Enters the code within the validity period
    DL-->>D: File download
  

Important

The security code is sent only to the email address or mobile number linked to the file. By default, the download link is valid for 24 hours and the PIN for 180 seconds; the administrator can change these periods. See Security.

Trusted JWT authentication

Service portals can authenticate their users in Riversoft STCP DirectLink by exchanging a JWT, signed with the portal’s private key, for a Riversoft STCP DirectLink Bearer token (token exchange). Riversoft STCP DirectLink validates the JWT with the JWT provider configuration registered by the administrator. The full flow is in Security.

Inbound and outbound connections

ConnectionWho starts itWhen
InboundPeople through the portal, systems through the API and partners over SFTP, AS2 or Webhook.Whenever the user decides, within their rules.
OutboundRiversoft STCP DirectLink connects to the partner’s server or to the cloud through the connectors.By schedule, on the defined dates or intervals. Through the Riversoft Console Portal, the operator can also run a schedule right away or start an outbound connection with a user.
SupervisionThe Riversoft STCP Gemini API connects to the Supervision (directlink) service of Riversoft STCP DirectLink (default port 33060).Whenever the Riversoft Console Portal tracks or operates the instance. See Supervision services.

Mailbox and directories

Each user has a mailbox in the data directory (DataDirectory, by default /usr/local/stcp/data), at the path <DataDirectory>/<instance>/<user>/. Riversoft STCP Gemini and Riversoft STCP DirectLink use exactly the same mailbox structure:

<DataDirectory>/<instance>/<user>/
├── entrada/
│   └── restart/
├── saida/
│   ├── backup/
│   ├── pendente/
│   └── link/
├── controle/
├── formato/
└── temp/
    flowchart LR
    SIS[Company system] -->|writes| SAI[saida]
    SAI -->|sent or downloaded| BKP[saida/backup]
    BKP -.->|resend| SAI
    PARC[Partner or user] -->|sends| ENT[entrada]
    ENT -->|read by| SIS
  
DirectoryIn Riversoft STCP GeminiIn Riversoft STCP DirectLink
entradaFiles received from the partner over OFTP.Files received by upload in the portal or the API and over the protocols and connectors.
entrada/restartRestart information for interrupted transfers.Restart information for interrupted transfers.
saidaFiles to send to the partner.Files available for download (download area) and to send through the connectors.
saida/backupFiles already sent. A file can go back to saida to be resent.Files already downloaded (backup area).
saida/pendenteEERP control: receipt confirmations waiting to be sent.—
saida/link—Files available by secure link for external recipients.
controleTransfer control files, such as EERP, NERP and locks.Transfer control files.
formato and tempFormat definitions and temporary files.Format definitions and temporary files.

Directory names are configurable in the instance. See Data directories.

File areas

In the Riversoft STCP DirectLink interface, each user sees three areas of their mailbox:

AreaDirectoryContents
DownloadsaidaFiles available for the user to receive.
Backupsaida/backupFiles already downloaded. A file moves from the download area to the backup area right after the download and stays there according to the configured retention policies.
Secure linksaida/linkFiles sent to external recipients by secure link.

Rules applied to each transfer

Before accepting an upload or releasing a download, Riversoft STCP DirectLink checks the operation against the user’s rules:

RuleEffect
User lockA locked user cannot exchange files.
Time windowTransfers are accepted only on the allowed days and times.
File filtersThe file name and size must meet the user’s filters.
External validation programWhen configured, a company program approves or rejects the file.
Host validationThe API rejects calls made from a host other than the configured one.
IntegrityThe upload can be validated by the file’s SHA-256 hash.

Every operation, accepted or rejected, is recorded. See Security.

Routing and automation

With routing enabled, Riversoft STCP DirectLink periodically scans the configured directories and forwards each file it finds according to a distribution table (CSV), which maps the file’s origin to the destinations and recipients.

    flowchart LR
    ARQ[File found<br/>in the directory] --> TAB{Distribution<br/>table}
    TAB -->|copy| DEST[Destination directory]
    TAB -->|link| LINK[Secure link for<br/>the recipients]
    TAB -->|external command| CMD[Company program]
    TAB --> BKP[Backup of the original]
  
StepWhat happens
IdentificationThe file’s origin and name are extracted from the file name by a regular expression.
ForwardingAccording to the table, the file is copied to the destination, generates a secure link for the recipients or is handed to an external command.
CompletionThe original is moved to backup or removed, depending on the configuration.

For more elaborate rename, copy, move and distribution rules, use Riversoft STCP Gemini Rename. The parameters are in Configuration › Routing and distribution.

Logging and monitoring

FeatureDescription
Log databaseEvery upload, download and access is recorded with user, file, date, time and result, when database logging is enabled (logDbEnable).
Events and messagesEach occurrence produces an event and a message with a code (MSGnnnn).
ReportsThe API provides reports of the user’s transfers. See Riversoft STCP DirectLink API.
TelemetryLogs, metrics and traces are exported in the OpenTelemetry standard. See Telemetry.
SupervisionThe Riversoft Console Portal tracks users and transfers.

See Monitoring and auditing.

Key concepts

ConceptDescription
UserPerson, system or partner that exchanges files. Each user has a single mailbox, the same one used by Riversoft STCP Gemini.
Download areaFiles available for the user to receive (saida directory).
Backup areaFiles already downloaded (saida/backup directory).
ConnectorLink to a protocol or external service, such as SFTP, AS2, FTPS, Webhook, WhatsApp or cloud storage (Amazon S3, Azure Blob Storage, Google Cloud Storage or Oracle Cloud Object Storage).
ScheduleExecution of outbound connections on defined dates or intervals. The schedule can also be run right away through the Riversoft Console Portal.
Secure linkDownload link sent to an external recipient by email, SMS or WhatsApp.
Security codePIN sent to the secure link recipient to release the download.
Bearer tokenCredential required on the API’s protected routes, obtained at sign-in.
Token exchangeExchange of a JWT from a trusted portal for a Bearer token.
Distribution tableCSV file that maps origins, destinations and recipients in routing.

Other terms are in the Glossary.