101 Commits

Author SHA1 Message Date
Milan Pavlik
9df5efe1c3 [public-api] Implement experimental ListTeams 2022-11-03 13:57:08 +01:00
Milan Pavlik
db13af4c8d [public-api] Implement experimental JoinTeam 2022-11-03 13:57:08 +01:00
Milan Pavlik
a470cdbfc2 [public-api] Refactor to support multiple token types 2022-11-03 13:38:08 +01:00
Milan Pavlik
91ecf0782e [public-api] Implement experimental JoinTeam 2022-11-03 08:57:08 +01:00
Milan Pavlik
66c9f2df22 [public-api] Add primary_email to TeamMember 2022-11-03 08:33:07 +01:00
Milan Pavlik
5af42c46c0 [public-api] Implement experimental GetTeam 2022-11-03 08:31:07 +01:00
Milan Pavlik
1b4966be80 [public-api] Populate full name and avatar for team members 2022-11-02 16:50:07 +01:00
Milan Pavlik
e24616b9fb [public-api] Implement experimental ListTeams 2022-11-02 09:50:06 +01:00
Milan Pavlik
45dcd0a5c3 [public-api] Implement member_since on TeamMember 2022-11-01 15:44:06 +01:00
Milan Pavlik
4c3007af75 [public-api] Implement experimental TeamsService.CreateTeam 2022-11-01 13:56:06 +01:00
Milan Pavlik
9d1a82446d [public-api] Implement connection pool with LRU cache 2022-10-31 13:59:05 +01:00
Milan Pavlik
45acc29cb1 [public-api] Export metrics with package label instead of service 2022-10-25 10:14:39 +02:00
Milan Pavlik
2d888a5ded [public-api] Move API definitions to experimental package 2022-10-19 17:23:34 +02:00
Milan Pavlik
063be607c6 [public-api] Add logs interceptor 2022-10-19 11:59:34 +02:00
Milan Pavlik
d6242ed18a [public-api] Remove unimplemented, or no longer needed RPCs 2022-10-19 10:34:34 +02:00
mustard
3075f3e533 [public-api] implement workspace proto 2022-10-19 09:42:34 +02:00
Milan Pavlik
bbc39b9d33 [public-api] Add client/server metrics interceptor 2022-10-19 09:33:34 +02:00
Milan Pavlik
0a476c52e8 [public-api] U Refactor to use connect handlers, route to HTTP server 2022-10-12 12:19:27 +02:00
Milan Pavlik
46d734e482 [public-api] Authentication interceptors for connect API 2022-10-10 16:54:26 +02:00
Milan Pavlik
e836dd4fe3 [public-api] Bind unimplemented WorkspacesServiceHandler using Connect 2022-10-06 16:06:22 +02:00
Anton Kosyakov
08a8412774 random exponential backoff of server connections 2022-10-05 11:16:20 +02:00
Milan Pavlik
31f273205f [proxy] Route HTTP 1.x requests to public-api-server 2022-10-05 07:56:20 +02:00
Manuel Alejandro de Brito Fontes
d5eb5815b5 Update to 1.19 2022-10-04 15:17:22 +02:00
Manuel Alejandro de Brito Fontes
3f6cbd07f1 Update go dependencies 2022-10-04 15:17:22 +02:00
Milan Pavlik
aa6a8ffb0e [public-api] Reeuse metrics registry from baseserver 2022-10-03 13:50:19 +02:00
Christian Weichel
d6023c989a Revert "Switch to Go workspaces"
This reverts commit 6bc34cf17512cb0a10a3a6cce44141b1f06b624e.
2022-09-29 05:28:29 +02:00
Christian Weichel
174a09222f Revert "Run go work sync"
This reverts commit 6b23167e09f74062b31150d4044a8fe7cacbc34b.
2022-09-29 05:28:29 +02:00
Christian Weichel
6b23167e09 Run go work sync 2022-09-28 08:45:28 +02:00
Christian Weichel
6bc34cf175 Switch to Go workspaces 2022-09-28 08:45:28 +02:00
Milan Pavlik
6f461f5714 [baseserver] Track metrics for HTTP requests automatically 2022-09-20 09:05:21 +02:00
Sven Efftinge
1b76bca17d [public-api] handle customer.subscription.deleted event
This event is fired by Stripe when a customer cancels their subscription
2022-09-16 16:24:17 +02:00
Milan Pavlik
42224aeee9 [baseserver] Add metric with version of the server, use in public api and usage 2022-09-16 14:20:17 +02:00
Milan Pavlik
c2b7421628 Fix stripe secret parsing 2022-08-30 10:58:14 +02:00
Milan Pavlik
40ab42e18a [public-api] Validate incoming stripe webhooks 2022-08-29 13:58:14 +02:00
Manuel Alejandro de Brito Fontes
438ffab694 Update k8s dependencies to v0.24.4 2022-08-23 08:18:39 +02:00
Manuel Alejandro de Brito Fontes
7b4a885ee3 Update k8s dependencies to v0.24.3 2022-08-23 08:18:39 +02:00
Andrew Farries
aba684fda1 Test webhook invokes FinalizeInvoice
TestWebhookInvokesFinalizeInvoiceRPC ensures that when the webhook is
hit with a `invoice.finalized` event, the `FinalizeInvoice` method on
the billing service is invoked with the invoice id from the event
payload.
2022-08-10 15:55:56 +02:00
Andrew Farries
d7416fd71d Add mock billing service
`mockgen --source client.go`
2022-08-10 15:55:56 +02:00
Andrew Farries
2d2f3e8b24 Make webhook use billingservice client
Construct and pass a billingservice client to the Stripe webhook so that
it can invoke the `FinalizeInvoice` RPC when the webhook is triggered.
2022-08-10 15:55:56 +02:00
Andrew Farries
c5ac85195b Add billingservice package to public-api-server
Takes the address of the billing service gRPC server and constructs a
client.

Also add a noop version of the client for when no billingservice is
configured (such as will be the case for self-hosted installations).
2022-08-10 15:55:56 +02:00
Andrew Farries
8586bc7fc3 Run 'leeway link' 2022-08-10 15:55:56 +02:00
Andrew Farries
c17cf53c8b Add leeway dependency to public-api-server
The public-api-server depends on the usage component as it will invoke
RPCs on the usage component billing server.
2022-08-10 15:55:56 +02:00
Andrew Farries
5ae8777513 Extract and log invoiceId in webhook 2022-08-10 15:25:54 +02:00
Andrew Farries
03d6f19013 Send valid payloads for stripe events
Add a minimal Stripe event payload for an `invoice.finalized` event.

Ensure all tests send event payloads. The only event type of interest
for the webhook is `invoice.finalized` so other event types can have
empty payloads.
2022-08-10 15:25:54 +02:00
Manuel Alejandro de Brito Fontes
7fd04928c7 Update go dependencies 2022-08-08 10:15:52 -03:00
Andrew Farries
c1a6f64e97 Add tests for the Stripe webhook
Test:
* The handler only accepts POST requests.
* The handler only responds to "invoice.finalized" events.

Add code to the handler to make those tests pass.
2022-08-05 10:12:49 -03:00
Andrew Farries
3218c48f67 Add http section to local usage config 2022-08-02 09:26:46 -03:00
Andrew Farries
a9958a0ffa Add Stripe webhook to public api server 2022-08-02 09:26:46 -03:00
Andrew Farries
9f31143458 go get github.com/gorilla/handlers 2022-08-02 09:26:46 -03:00
Andrew Farries
0d8584cf42 go get github.com/stripe/stripe-go/v72 2022-08-02 09:26:46 -03:00