Commit Graph

250 Commits

Author SHA1 Message Date
Oliver Gugger
e2757ebca8 proxy: always return 200 status code to gRPC client
It turns out that sending a non-200 HTTP status code was against the
gRPC spec and the older versions of the `grpc` library just didn't
validate that. The validation was added in v1.40.0, which is the version
that we couldn't update to before.
With this fix the error is still parsed correctly on the client side.
But this requires a small change to the L402 spec because the status
code is no longer 402.
2023-06-15 13:32:14 +02:00
Oliver Gugger
369489feb7 Merge pull request #96 from positiveblue/sql
Add support for sqlite/postgres database backends
2023-06-15 10:42:59 +02:00
positiveblue
33d53b2a2f ci: run unit tests against sqlite and postgres 2023-06-14 21:44:20 -07:00
positiveblue
bf96592f63 aperture: initialize server with the configured db backend 2023-06-14 21:44:20 -07:00
positiveblue
a9fb600044 config: support params for different database backends 2023-06-14 21:44:19 -07:00
positiveblue
680da97b62 aperturedb: implement onion store 2023-06-14 21:44:19 -07:00
positiveblue
9c5453b410 aperturedb: implement secrets store 2023-06-14 21:44:19 -07:00
positiveblue
6700d01b39 aperturedb: add support for postgres/sqlite 2023-06-14 21:44:17 -07:00
positiveblue
bddbc9326d ci: add sqlc codegen check to pipeline 2023-06-14 21:36:19 -07:00
positiveblue
f5dd767145 aperturedb: add table+queries for secrets and onion 2023-06-14 21:30:56 -07:00
positiveblue
f0c27c896c sqlc: add support for code generation 2023-06-14 21:30:53 -07:00
Olaoluwa Osuntokun
481a8f5a47 Merge pull request #101 from Roasbeef/rpc-yaml-fix
build: fix yaml indentation issue
2023-06-14 22:46:46 -05:00
Olaoluwa Osuntokun
520e40dedc build: properly add check-rest-annotations.sh
The builds fails otherwise. The Makefile has also been modified to use
the proper path here.
2023-06-14 20:13:12 -05:00
Olaoluwa Osuntokun
fa51fd5d8a build: fix yaml indentation issue 2023-06-14 19:48:26 -05:00
Olaoluwa Osuntokun
68b8d1b491 Merge pull request #99 from Roasbeef/pricesrpc-full-req
multi: extend the pricesrpc interface to pass in the full HTTP request context
2023-06-14 19:44:47 -05:00
Olaoluwa Osuntokun
c396ca51b7 prices: rename proto file to prices.proto
This fixes a registration conflict with the set of etcd protos.
2023-06-13 20:43:18 -05:00
Olaoluwa Osuntokun
40df8f8339 proxy+pricer: pass in the entire HTTP requests for GetPrice
In this commit, we modify the `GetPrice` method and interface to accept
the full request instead of _just_ the path. For backwards compat, we
leave the path in place, but also include the full serialized HTTP
request.
2023-06-13 20:43:14 -05:00
Olaoluwa Osuntokun
3a5dd96a95 pricesrpc: add http_request_text to GetPrice
In this commit, we add the http_request_text to the `GetPrice` RPC call.
This'll contain the fully serialized HTTP request, which'll permit the
back end to check things like the set of headers or request body, which
may be useful in more fine grained pricing functions.

One example is: when proxying requests to an LLM platform provider, the
backed may want to charge more based on the length of the
context/message and/or which model is being used.
2023-06-13 20:43:12 -05:00
Olaoluwa Osuntokun
e8fa845478 pricesrpc: run new proto generation script for pricesrpc 2023-06-13 20:43:10 -05:00
Olaoluwa Osuntokun
1fbafb04f9 build: add proto generation script for pricesrpc and CI integration 2023-06-13 20:43:07 -05:00
Olaoluwa Osuntokun
9b85f8bbc6 Merge pull request #93 from Roasbeef/doc-updates
docs: update docs, mention new minimum Go version
2023-04-28 12:46:21 -05:00
Oliver Gugger
27ccd581b1 Merge pull request #81 from bucko13/poc-creation-time-caveat
Timeout Caveat Support
2023-04-26 08:55:32 +02:00
Buck Perley
62f604bfe8 aperture: adds timeout option for services for relative expiration 2023-04-25 23:29:31 -05:00
Olaoluwa Osuntokun
d19168130b docs: update docs, mention new minimum Go version 2023-04-20 15:50:37 -07:00
Oliver Gugger
fa7df9e11f Merge pull request #92 from lightninglabs/lnd-0-16-0-final
mod: bump lnd to v0.16.0-beta
v0.1.20-beta
2023-03-29 15:36:41 +02:00
Oliver Gugger
fec2bbee26 mod: bump lnd to v0.16.0-beta 2023-03-29 15:30:04 +02:00
Oliver Gugger
b952e4ee6f Merge pull request #85 from lightninglabs/lnd-16
prepare for lnd 0.16
2023-02-27 13:43:49 +01:00
Oliver Gugger
27f3a1e15a multi: fix grpc version issue 2023-02-27 13:36:56 +01:00
Oliver Gugger
2b1feae753 multi: bump lnd+lndclient compile time dependency 2023-02-27 13:36:54 +01:00
Oliver Gugger
f7883eb1a5 Merge pull request #89 from lightninglabs/dependabot/go_modules/golang.org/x/crypto-0.1.0
build(deps): bump golang.org/x/crypto from 0.0.0-20211215153901-e495a2d5b3d3 to 0.1.0
2023-02-27 12:26:48 +01:00
dependabot[bot]
eabc2c1dc2 build(deps): bump golang.org/x/crypto
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.0.0-20211215153901-e495a2d5b3d3 to 0.1.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/commits/v0.1.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 08:33:29 +00:00
Oliver Gugger
28849d1205 Merge pull request #88 from lightninglabs/dependabot/go_modules/golang.org/x/net-0.7.0
build(deps): bump golang.org/x/net from 0.0.0-20220722155237-a158d28d115b to 0.7.0
2023-02-27 09:32:40 +01:00
dependabot[bot]
71136e6b96 build(deps): bump golang.org/x/net
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.0.0-20220722155237-a158d28d115b to 0.7.0.
- [Release notes](https://github.com/golang/net/releases)
- [Commits](https://github.com/golang/net/commits/v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-25 01:46:07 +00:00
Oliver Gugger
70cefb99ec Merge pull request #86 from lightninglabs/dependabot/go_modules/github.com/prometheus/client_golang-1.11.1
build(deps): bump github.com/prometheus/client_golang from 1.11.0 to 1.11.1
2023-02-15 11:55:21 +01:00
dependabot[bot]
85f5d953da build(deps): bump github.com/prometheus/client_golang
Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/prometheus/client_golang/releases)
- [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prometheus/client_golang/compare/v1.11.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/prometheus/client_golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-15 02:42:15 +00:00
Oliver Gugger
9badd7fb5e multi: remove Tor v2 support v0.1.19-beta 2023-01-27 16:42:23 +01:00
Oliver Gugger
9998883cbc Merge pull request #84 from ffranr/upgrade_lnd_tor
Upgrade lnd tor to version v1.1.0
2023-01-27 16:34:18 +01:00
ffranr
4f8e09f156 lint: remove depreciated tls config field
From the docs:
PreferServerCipherSuites is a legacy field and has no effect.
It used to control whether the server would follow the client's or the
server's preference. Servers now select the best mutually supported
cipher suite based on logic that takes into account inferred client
hardware, server hardware, and security.
2023-01-27 13:27:38 +00:00
ffranr
db30c8384d lint: remove depreciated io/ioutil
As of Go 1.16, functionality provided in io/ioutil has been depreciated
in favour of the io or os packages. Now that Go has been
upgraded in go.mod, the linter will not pass without these changes.
2023-01-27 13:27:38 +00:00
ffranr
73ed7bfc52 lint: rename private struct field: freebieDb
freebieDb -> freebieDB
Change suggested by linter stylecheck (rule: ST1003).
2023-01-27 12:41:18 +00:00
ffranr
f241a966e0 lint: correct formatting 2023-01-27 12:41:17 +00:00
ffranr
6e9bd0d784 lint: gocritic: silence append func warning 2023-01-27 12:41:17 +00:00
ffranr
daf5aa00e3 lint: disable new sub-linters to match pre-upgrade
This change ensures that the majority of the codebase still passes the
newly upgraded linter.
2023-01-27 12:41:16 +00:00
ffranr
12f949758b lint: use linter from aperture-tools docker image 2023-01-27 12:41:10 +00:00
ffranr
97dbfca77c lint: add codebase tools directory
Update golangci-lint: v1.18.0 --> v1.50.1
Linter was updated to fix internal panic which was probably caused by
the Golang update.

The tools directory contains helper programs for managing the health of
the codebase. The directory is based on the equivalent directory found
in the taro codebase at commit 64e9dc9ccadb9269a1985ce2ff03cfc3a83d0470
2023-01-27 12:36:23 +00:00
ffranr
0096d68a48 ci+docker: bump go version 2023-01-27 12:34:19 +00:00
ffranr
8694f147d5 unit tests: remove use of onion type V2
We only support tor V3.
2023-01-27 12:34:18 +00:00
ffranr
158eb0bed1 onion_store: remove tor V2 + use new OnionStore
The target version of the tor.OnionStore interface methods do not accept
onion type as an argument. Further, tor V2 was depreciated in October
2021. We can therefore remove support for tor V2.
2023-01-27 12:34:18 +00:00
ffranr
a5659a82cb go.mod+go.sum: run: go mod tidy 2023-01-27 12:29:45 +00:00
ffranr
bd9102b65b go.mod: bump go version 2023-01-27 12:29:44 +00:00