Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Support SFTP in ACH file transfers #179

Merged
merged 27 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3d1db91
internal/filetransfer: create a new package from file transfer code
adamdecaf Jul 15, 2019
9265406
internal/filetransfer: initial addition of the SFTP Agent
adamdecaf Jul 16, 2019
4e0292e
internal/filetransfer: split out FTP tests from file_transfer_test.go
adamdecaf Jul 16, 2019
cbd7aa9
internal/filetransfer: add sftp_configs table with tests
adamdecaf Jul 17, 2019
5095a32
internal/filetransfer: pass along sftp configs to our SFTPTransferAgent
adamdecaf Jul 18, 2019
5675898
internal/filetransfer: experiment with SFTP's NewClientPipe and a tes…
adamdecaf Jul 18, 2019
d0e7551
internal/filetransfer: close ssh.Client if we fail our SFTP connection
adamdecaf Jul 18, 2019
7600dd2
internal/filetransfer: override defaults for our SFTP client
adamdecaf Jul 18, 2019
7437b6e
internal/filetransfer: misc improvements to docs
adamdecaf Jul 18, 2019
15002cc
internal/filetransfer: close SFTP agent in deployment.close()
adamdecaf Jul 19, 2019
b1aa38e
internal/filetransfer: close agent and check ping in remote SFTP test
adamdecaf Jul 19, 2019
c4aebbd
internal/filetransfer: retry on SFTP client create
adamdecaf Jul 19, 2019
6b728e0
internal/filetransfer: lower SFTP MaxPacket
adamdecaf Jul 19, 2019
1a9798f
internal/filetransfer: get our test working with a Docker image
adamdecaf Jul 19, 2019
ca4154a
internal/filetransfer: include a test SFTP config for atmoz/sftp:latest
adamdecaf Jul 19, 2019
4072b1a
internal/filetransfer: bump up test coverage
adamdecaf Jul 19, 2019
70a263c
internal/filetransfer: add stub HTTP endpoints for SFTP configs
adamdecaf Jul 19, 2019
9daae75
Merge remote-tracking branch 'origin/master' into split-out-file-tran…
adamdecaf Jul 22, 2019
d95f810
files: minify fileTransferController.getDetails type surface area
adamdecaf Jul 22, 2019
ea6eda1
files: pass through filetransfer type from routing numbers
adamdecaf Jul 22, 2019
8a2e03c
internal/httptest: test GrabConnectionCertificates
adamdecaf Jul 22, 2019
4ec3783
files: capture first error in writeFiles
adamdecaf Jul 23, 2019
5c65e29
files: 'mkdir -p' when writing files
adamdecaf Jul 23, 2019
c10091f
internal/filetransfer: add an example SFTP server with test files
adamdecaf Jul 23, 2019
b8fc8c7
internal/filetransfer: add more tests
adamdecaf Jul 23, 2019
47982de
internal/filetransfer: test sftp Delete
adamdecaf Jul 23, 2019
4b6f9bb
internal/filetransfer: sftp test GetInboundFiles() and GetReturnFiles()
adamdecaf Jul 23, 2019
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Based on `DATABASE_TYPE` the following environment variables will be read to con

##### MySQL

- `MYSQL_ADDRESS`: TCP address for connecting to the mysql server. (example: `localhost:3306`)
- `MYSQL_ADDRESS`: TCP address for connecting to the mysql server. (example: `tcp(hostname:3306)`)
- `MYSQL_DATABASE`: Name of database to connect into.
- `MYSQL_PASSWORD`: Password of user account for authentication.
- `MYSQL_USER`: Username used for authentication,
Expand All @@ -158,6 +158,8 @@ Twitter [@moov_io](https://twitter.com/moov_io) | You can follow Moov.IO's Twitt

Yes please! Please review our [Contributing guide](CONTRIBUTING.md) and [Code of Conduct](https://github.com/moov-io/ach/blob/master/CODE_OF_CONDUCT.md) to get started!

Paygate includes several "long" tests which spawn Docker containers, make requests over the internet, and perform more complicated tests. To skip these long tests add the `-short` flag to `go test`.

Note: This project uses Go Modules, which requires Go 1.11 or higher, but we ship the vendor directory in our repository.

### Test Coverage
Expand Down
17 changes: 0 additions & 17 deletions common.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,6 @@ func (a *Amount) UnmarshalJSON(b []byte) error {
return a.FromString(s)
}

var errTimeout = errors.New("timeout exceeded")

// try will attempt to call f, but only for as long as t. If the function is still
// processing after t has elapsed then errTimeout will be returned.
func try(f func() error, t time.Duration) error {
answer := make(chan error)
go func() {
answer <- f()
}()
select {
case err := <-answer:
return err
case <-time.After(t):
return errTimeout
}
}

// startOfDayAndTomorrow returns two time.Time values from a given time.Time value.
// The first is at the start of the same day as provided and the second is exactly 24 hours
// after the first.
Expand Down
22 changes: 0 additions & 22 deletions common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,6 @@ func TestAmount__json(t *testing.T) {
}
}

func TestTry(t *testing.T) {
start := time.Now()

err := try(func() error {
time.Sleep(50 * time.Millisecond)
return nil
}, 1*time.Second)

if err != nil {
t.Fatal(err)
}

diff := time.Since(start)

if diff < 50*time.Millisecond {
t.Errorf("%v was under 50ms", diff)
}
if limit := 2 * 100 * time.Millisecond; diff > limit {
t.Errorf("%v was over %v", diff, limit)
}
}

func TestStartOfDayAndTomorrow(t *testing.T) {
now := time.Now()
min, max := startOfDayAndTomorrow(now)
Expand Down
171 changes: 0 additions & 171 deletions file_transfer.go

This file was deleted.

Loading