From 5de0b5cbd4ce25ff39c240915f8725299f4091ea Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Fri, 10 May 2024 12:44:17 -0500 Subject: [PATCH] fix:basic auth user -> username attribute change (#61) * fix:basic auth user -> username attribute change * chore: go generate * chore: order schema attributres alphabetically * chore(examples): add source auth to full example * chore: go generate --- .gitignore | 4 +++- docs/resources/source_verification.md | 2 +- examples/full/main.tf | 13 +++++++++++-- .../sourceverification/verification_basicauth.go | 6 +++--- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 793924c..3fde553 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,6 @@ website/vendor # Keep windows files with windows line endings *.winfile eol=crlf -/examples/dev \ No newline at end of file +/examples/dev + +*.lock.hcl \ No newline at end of file diff --git a/docs/resources/source_verification.md b/docs/resources/source_verification.md index 67ea3ce..17fd727 100644 --- a/docs/resources/source_verification.md +++ b/docs/resources/source_verification.md @@ -122,8 +122,8 @@ Required: Required: -- `name` (String) - `password` (String, Sensitive) +- `username` (String) diff --git a/examples/full/main.tf b/examples/full/main.tf index f6dd715..bf001c5 100644 --- a/examples/full/main.tf +++ b/examples/full/main.tf @@ -9,8 +9,7 @@ variable "HEADER_FILTER_VALUES" { terraform { required_providers { hookdeck = { - source = "hookdeck/hookdeck" - version = "~> 0.3.1" + source = "hookdeck/hookdeck" } } } @@ -23,6 +22,16 @@ resource "hookdeck_source" "my_source" { name = "my_source" } +resource "hookdeck_source_verification" "my_authenticated_source" { + source_id = hookdeck_source.my_source.id + verification = { + basic_auth = { + username = "example-username" + password = "example-password" + } + } +} + resource "hookdeck_destination" "my_destination" { name = "my_destination" url = "https://mock.hookdeck.com" diff --git a/internal/provider/sourceverification/verification_basicauth.go b/internal/provider/sourceverification/verification_basicauth.go index 5e1b557..a3d477a 100644 --- a/internal/provider/sourceverification/verification_basicauth.go +++ b/internal/provider/sourceverification/verification_basicauth.go @@ -10,13 +10,13 @@ func basicAuthConfigSchema() schema.SingleNestedAttribute { return schema.SingleNestedAttribute{ Optional: true, Attributes: map[string]schema.Attribute{ - "name": schema.StringAttribute{ - Required: true, - }, "password": schema.StringAttribute{ Required: true, Sensitive: true, }, + "username": schema.StringAttribute{ + Required: true, + }, }, } }