Skip to content

Commit ae51ba8

Browse files
hyperpolymathclaude
andcommitted
feat(v-lang): add 10 V-lang connectors (graphdb, objectstore, ldap, vpn, ftp, webdav, opcua, modbus, voip, xmpp)
Phase 2 remaining connectors (graphdb, objectstore, ldap, vpn) receive v.mod files. Phase 3 start: 6 new connectors (ftp, webdav, opcua, modbus, voip, xmpp) with full src/main.v, src/abi/Types.idr, v.mod, README.adoc, and contractiles/Trustfile.a2ml. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 07df044 commit ae51ba8

File tree

34 files changed

+4302
-0
lines changed

34 files changed

+4302
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
= v-ftp
2+
// SPDX-License-Identifier: PMPL-1.0-or-later
3+
4+
FTP/FTPS protocol connector for the V-Ecosystem API interfaces layer.
5+
Implements the File Transfer Protocol (RFC 959) with TLS upgrade via AUTH TLS (RFC 4217).
6+
Supports active and passive transfer modes, directory listing, file upload/download, rename, and delete operations over the FTP control/data channel architecture.
7+
8+
== Author
9+
10+
Jonathan D.A. Jewell
11+
12+
== Source
13+
14+
`src/ftp.v`
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Trustfile.a2ml -- v-ftp
2+
# SPDX-License-Identifier: PMPL-1.0-or-later
3+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
4+
#
5+
# Contractile trust specification for the v-ftp protocol module.
6+
# Evaluated by the contractile-cli (must/trust/dust/intend/k9) toolchain.
7+
8+
[trust]
9+
post-quantum-keys = "pending"
10+
threat-model = "network-facing-file-transfer"
11+
formal-verification = "idris2-abi"
12+
audit-status = "unaudited"
13+
14+
[must]
15+
invariant-checks = ["input-validation", "path-traversal-prevention", "response-code-validation", "transfer-mode-enforcement", "tls-upgrade-verification"]
16+
build-contract = "v build src/"
17+
18+
[dust]
19+
recovery = "reconnect-with-backoff"
20+
rollback = "abort-transfer-close-data-channel"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
-- SPDX-License-Identifier: PMPL-1.0-or-later
2+
-- Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath)
3+
--
4+
-- Idris2 ABI type definitions for the v-ftp protocol.
5+
-- FTP transfer modes, response codes, directory entry types,
6+
-- and connection lifecycle states.
7+
8+
module Types
9+
10+
import Data.List
11+
12+
||| FTP transfer mode (active vs passive data channel establishment).
13+
public export
14+
data TransferMode : Type where
15+
Active : TransferMode -- Server connects back to client data port
16+
Passive : TransferMode -- Client connects to server-provided data port
17+
18+
||| FTP representation type for data transfer encoding.
19+
public export
20+
data RepresentationType : Type where
21+
ASCII : RepresentationType -- Text mode with CRLF line endings
22+
Binary : RepresentationType -- Image/binary mode, no conversion
23+
24+
||| FTP connection lifecycle state.
25+
public export
26+
data ConnState : Type where
27+
Disconnected : ConnState
28+
Connected : ConnState -- Control channel established
29+
Authenticated : ConnState -- USER/PASS accepted
30+
Transferring : ConnState -- Data channel active
31+
32+
||| FTP response code category (first digit per RFC 959).
33+
public export
34+
data ResponseCategory : Type where
35+
Preliminary : ResponseCategory -- 1xx: positive preliminary
36+
Completion : ResponseCategory -- 2xx: positive completion
37+
Intermediate : ResponseCategory -- 3xx: positive intermediate
38+
TransientNeg : ResponseCategory -- 4xx: transient negative
39+
PermanentNeg : ResponseCategory -- 5xx: permanent negative
40+
41+
||| A parsed FTP server response with numeric code and text message.
42+
public export
43+
record FtpResponse where
44+
constructor MkFtpResponse
45+
code : Nat
46+
message : String
47+
48+
||| Directory entry metadata returned by LIST or MLSD commands.
49+
public export
50+
record DirEntry where
51+
constructor MkDirEntry
52+
name : String
53+
size : Nat
54+
entryType : String -- "file", "dir", "link"
55+
modified : String -- ISO 8601 timestamp
56+
perms : String -- Unix-style permission string

0 commit comments

Comments
 (0)