Commit Graph

189 Commits

Author SHA1 Message Date
Aaron Lindsay 2641443ebe BasicClient: Add ability to set User-Agent header
Some financial institutions require specific values in the User-Agent
header.
2021-03-16 15:36:27 -04:00
David Alpert 01b26887af GH-39 relax ofx response parsing to support TYPE1 responses
Section 4.2.2.2 Type 1 Protocol Overview in the
[Open Financial Exchange Specification 2.2, Nov 26, 2017](https://www.ofx.net/downloads/OFX%202.2.pdf)
states that:

    Type 1 applies only to the request part of a message; the server response is unaffected.

Thus it appears that we can safely parse SECURITY:TYPE1
using the same logic that we parse SECURITY:NONE

As I understand it, Security:TYPE1 indicates that the
financial institution uses SSL enryption to protect
customer credentials in transit.  This applies
explicitly to the incoming requests which may
contain authentication as part of the request
but does not appear to cause any material changes
to the response format.

As a result it appears that we can safely parse
SECURITY:TYPE1 responess in the same way that
we parse SECURITY:NONE responsese.
2021-03-12 10:46:24 -05:00
Aaron Ross 2b8a79e4b7 review changes 2021-01-04 07:24:40 -05:00
Aaron Ross 9136c9bab2 README: add example for parsing local file 2021-01-04 07:24:40 -05:00
Aaron Ross 0d93a42626 support SGML OFX responses with no line breaks
Some financial institutions (*cough* Wells Fargo *cough*) export OFX files as a single line, which is technically valid according to the v1 spec. In order to parse them correctly, `readSGMLHeaders` now uses a regular expression that allows for all whitespace/line breaks to be optionally excluded.

A new sample response (wellsfargo.qfx) has been added to document this behaviour.
2021-01-04 07:24:40 -05:00
Aaron Lindsay 56ca46714b cmd/ofx: Add -dryrun 2020-12-07 13:49:35 -05:00
Aaron Lindsay 4c7c48cab7 cmd/ofx: Use 'response.ofx' as the default download file everywhere
Conflicting defaults led to confusing default behavior between
sub-commands.
2020-12-07 13:49:35 -05:00
Aaron Lindsay 8c1e6eafab cmd/ofx: Add download-profile command 2020-11-25 14:42:25 -05:00
Aaron Lindsay 52f3e4120b README: Replace Travis badge with GitHub Actions 2020-11-25 07:18:43 -05:00
Aaron Lindsay ef87cc536c Replace Travis CI with Github Actions 2020-11-25 07:09:08 -05:00
Aaron Lindsay 830a6064c7 .travis.yml: Set Go 1.12 as the minimum version
I'm getting errors when attempting to build with any older version:

    golang.org/x/term
    # golang.org/x/term
    ../../../golang.org/x/term/term_unix_linux.go:9:7: ioctlReadTermios redeclared in this block
	    previous declaration at ../../../golang.org/x/term/term_unix_aix.go:9:26
    ../../../golang.org/x/term/term_unix_linux.go:10:7: ioctlWriteTermios redeclared in this block
	    previous declaration at ../../../golang.org/x/term/term_unix_aix.go:10:27
2020-11-17 10:33:48 -05:00
Aaron Lindsay 6807c93e0e cmd/ofx: Add option to use carriage returns for requests 2020-11-17 10:33:48 -05:00
Aaron Lindsay 10edd94920 Vanguard client: Accept 500 errors on initial response
Though their server returns a 500 HTTP status code, it still sets the
required cookies on the response that we can use to make a second
request.
2020-11-17 10:33:48 -05:00
Aaron Lindsay d88d45a664 signon: Add missing GENUSERKEY field 2020-11-17 10:33:48 -05:00
Aaron Lindsay 2caa23564a Fix spelling of 'Withholding' 2020-11-07 16:45:55 -05:00
Aaron Lindsay 5923a34de0 README: Fix bad documentation badge link 2020-10-06 23:15:00 -04:00
Aaron Lindsay aa4d8074b2 Fix spelling error 2020-10-06 23:14:42 -04:00
Aaron Lindsay 65cc26a0db Make golint happy 2020-10-06 23:14:42 -04:00
Aaron Lindsay 8f3e7309f2 Add comments to a few exported methods 2020-10-06 23:14:42 -04:00
Aaron Lindsay 631508ccc9 README: Move from godoc.org to pkg.go.dev 2020-10-06 22:46:45 -04:00
Aaron Lindsay 60a5707de6 Update dependencies 2020-10-06 22:38:40 -04:00
Aaron Lindsay 3240ef383b README: Update build status badge 2020-10-06 22:19:44 -04:00
John Starich 8ad638c7e2 Rename ofxgo_test package to ofxgo and remove self-imports/references
* Fix package in generate_constants.py
* Update generate_constants.py to use the new imports
2020-04-03 08:38:41 -04:00
John Starich f19189de45 Add DecodeResponse and *Response.Valid() for fine-grained parse control 2020-03-31 11:42:08 -04:00
John Starich 677a09295a Continue parsing after hitting validation errors
Supports mixed-case severity for Ally Bank's Quicken downloads 🙄
2020-03-30 10:50:10 -04:00
John Starich f75592381a Add Go version to go.mod for compatibility guarantees 2020-03-30 10:50:10 -04:00
Aaron Lindsay ebf7f5b757 Update xml module 2019-07-01 06:11:17 -04:00
John Starich 212fdc731b Omit end tags for encoding OFX 100-series requests
Closes https://github.com/aclindsa/ofxgo/issues/18
2019-07-01 06:11:16 -04:00
John Starich 66dd37781f Remove old cover tool installer 2019-07-01 06:01:57 -04:00
John Starich 67e527c855 Support carriage returns on new lines 2019-06-26 06:23:52 -04:00
Aaron Lindsay f41286cac7 .travis.yml: Add Go 1.12 2019-03-06 06:50:30 -05:00
Aaron Lindsay 423d460747 Bank transactions: Allow transaction currencies to be empty
The XML marahaller will attempt to marshal the top-level elements, not
knowing that the lower-level elements are empty. Making them pointers
solves this.
2019-03-06 06:00:05 -05:00
Aaron Lindsay 3e8a9c5a53
Merge pull request #16 from aclindsa/writable_responses
Allow for marshalling Response objects to strings containing XML/SGML
2019-03-02 15:33:38 -05:00
Aaron Lindsay 35c7116654 Add the ability to marshal a Response to SGML/XML and test it
This allows for ofxgo to be used to create well-formatted OFX from poor
OFX, or even be used to generate OFX from other formats for easier
importing into financial management software.

Test this functionality by adding "round trip" testing to all existing
tests - ensure that responses' content is the same after a round trip of
marshalling and unmarshalling them.
2019-03-02 07:03:11 -05:00
Aaron Lindsay 286e619071 Pull out writing the OFX header to its own function
This is in preparation for also allowing responses to be written via the
library (as opposed to only read).
2019-03-01 05:51:36 -05:00
Aaron Lindsay 9dd9c3bd3f Include 'cmd' module dependencies 2019-03-01 05:50:46 -05:00
Martin Kobetic 0f6ceccd86 Work around missing blank line after last header
Detect when a newline doesn't follow the last header when parsing SGML and break out of the header-parsing loop early. Add an example .qfx file demonstrating the broken behavior we're working around and a test.
2019-01-04 11:18:55 -05:00
Aaron Lindsay 7691881132
Merge pull request #13 from aclindsa/dep_to_go_mod
Switch from `dep` to `go mod`
2018-10-11 21:08:30 -04:00
Aaron Lindsay 61262b87d8 Switch from `dep` to `go mod` 2018-10-11 21:00:03 -04:00
Aaron Lindsay 5e2e3a2bf7
Merge pull request #12 from aclindsa/discover_hack
Add Hack for Discover
2018-10-08 06:00:36 -04:00
Aaron Lindsay 22a6d65b98 Add Hack for Discover
Discover requires an exact set of headers in exact order, or it returns
HTTP 403.
2018-10-08 05:55:08 -04:00
Aaron Lindsay 77b154695f detect_settings: Add newer APPVER's for 'QWIN' APPID 2018-10-04 06:50:38 -04:00
Aaron Lindsay ac09538ec3
Merge pull request #11 from aclindsa/make_client_interface
Make Client an interface instead of a struct
2018-10-03 10:23:40 -04:00
Aaron Lindsay d8491bed1d Make Client an interface instead of a struct
This makes it easier to maintain per-institution hacks that start
interacting with each other if you try to do them all in the same client
code. This commit also breaks out the existing Vanguard hack into its
own Client implementation.
2018-10-03 10:18:54 -04:00
Aaron Lindsay 1b4f27b31f
Merge pull request #10 from aclindsa/update_dependencies
Update dependencies
2018-10-02 21:07:02 -04:00
Aaron Lindsay eb35a26986 Update dependencies 2018-10-02 21:01:03 -04:00
Aaron Lindsay 5c10ac5ea1
Merge pull request #9 from aclindsa/client_interface
Add BasicClient, update Client to be interface
2018-10-02 21:00:44 -04:00
Aaron Lindsay 94a77ac754 Add BasicClient, update Client to be interface
This paves the way for more easily implementing different clients for
different financial institutions
2018-10-02 20:55:25 -04:00
Aaron Lindsay de58d3fc0d
Merge pull request #8 from aclindsa/remove_unused_default_client
client.go: remove unused defaultClient var
2018-10-02 20:41:42 -04:00
Aaron Lindsay 88e5521348 client.go: remove unused defaultClient var 2018-10-02 20:33:33 -04:00