Skip to content

Commit

Permalink
feat(webhooks): Add signature algo field (#117)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Denquin <[email protected]>
  • Loading branch information
jdenquin and jdenquin authored Aug 10, 2023
1 parent ceb005d commit a5c2a95
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions webhook_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ import (
"github.com/google/uuid"
)

type SignatureAlgo string

const (
JWT SignatureAlgo = "jwt"
HMac SignatureAlgo = "hmac"
)

type WebhookEndpointRequest struct {
client *Client
}
Expand All @@ -18,7 +25,8 @@ type WebhookEndpointParams struct {
}

type WebhookEndpointInput struct {
WebhookURL string `json:"webhook_url,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
SignatureAlgo SignatureAlgo `json:"signature_algo,omitempty"`
}

type WebhookEndpointListInput struct {
Expand All @@ -33,10 +41,11 @@ type WebhookEndpointResult struct {
}

type WebhookEndpoint struct {
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoOrganizationID uuid.UUID `json:"lago_organization_id,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
LagoID uuid.UUID `json:"lago_id,omitempty"`
LagoOrganizationID uuid.UUID `json:"lago_organization_id,omitempty"`
WebhookURL string `json:"webhook_url,omitempty"`
SignatureAlgo SignatureAlgo `json:"signature_algo,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}

func (c *Client) WebhookEndpoint() *WebhookEndpointRequest {
Expand Down

0 comments on commit a5c2a95

Please sign in to comment.