Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend): add share_key field #463

Merged
merged 1 commit into from
Aug 30, 2023
Merged

Conversation

Integralist
Copy link
Collaborator

@Integralist Integralist commented Aug 7, 2023

I tested this locally using the following script and was seeing an API validation error. This validation error was fixed internally by Fastly and now when running the script I get the expected valid! true output.

package main

import (
	"fmt"
	"log"
	"os"

	"github.com/fastly/go-fastly/v8/fastly"
)

func main() {
	client, err := fastly.NewClient(os.Getenv("FASTLY_API_KEY"))
	if err != nil {
		log.Fatal(err)
	}

	serviceID := "<REDACTED>"

	_, err = client.UpdateBackend(&fastly.UpdateBackendInput{
		Name:           "example-backend",
		ShareKey:       fastly.String("<REDACTED>"),
		ServiceID:      serviceID,
		ServiceVersion: 1,
	})
	if err != nil {
		log.Fatal(err)
	}

	valid, reason, err := client.ValidateVersion(&fastly.ValidateVersionInput{
		ServiceID:      serviceID,
		ServiceVersion: 1,
	})
	if err != nil {
		log.Fatal(err)
	}
	if !valid {
		log.Fatalf("not valid version '%s': %s", reason, err)
	}

	fmt.Printf("valid! %#v\n", valid)
}

@Integralist Integralist added the enhancement New feature or request label Aug 7, 2023
@Integralist Integralist force-pushed the integralist/share-key branch from 0bea018 to cb5ac03 Compare August 7, 2023 10:11
@Integralist Integralist force-pushed the integralist/share-key branch from cb5ac03 to 188fcc9 Compare August 30, 2023 10:11
@Integralist Integralist merged commit f8ad454 into main Aug 30, 2023
@Integralist Integralist deleted the integralist/share-key branch August 30, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant