Skip to content

Configuration Error and Incorrect Docs Examples #191

@kyleboe

Description

@kyleboe

Version

fastly (13.1.0)
Ruby 3.4.0

What happened

As stated in the README, I initialize the client with:

# Rails.application.credentials.fastly_api_token is a valid, confirmed-working API token
Fastly.configure do |config|
  config.api_token = Rails.application.credentials.fastly_api_token
end

This results in an error:

IndexError: string not matched
from .../fastly-13.1.0/lib/fastly/configuration.rb:60:in 'String#[]='

When setting api_key instead:

Fastly.configure do |config|
  config.api_key = Rails.application.credentials.fastly_api_token
end

There is no error and the value of Rails.application.credentials.fastly_api_token is the output.

However, with config.api_key set, all requests fail with a 401 response.

I can only get things working if I forcibly set the environment variable:

ENV["FASTLY_API_TOKEN"] = Rails.application.credentials.fastly_api_token

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions