Skip to content

Fix typo in token authentication example#54

Open
RadmilaKovacic wants to merge 3 commits intoionos-cloud:v2from
RadmilaKovacic:v2
Open

Fix typo in token authentication example#54
RadmilaKovacic wants to merge 3 commits intoionos-cloud:v2from
RadmilaKovacic:v2

Conversation

@RadmilaKovacic
Copy link

Description

This PR fixes a typo in the token authentication code example.

Changes Made

  • Changed authApi.NewConfigurationFromEnv() to auth.NewConfigurationFromEnv()
  • This matches the actual imported package name auth

Why This Change?

The code example was using authApi which is not defined, when it should use auth which is the imported package.

Changed
authApi.NewConfigurationFromEnv() to auth.NewConfigurationFromEnv() 

to match the imported package name.
Fix typo in token authentication example
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a typo in the README’s token authentication example by updating the referenced configuration constructor to match the intended package name.

Changes:

  • Updated the token-auth code example to use auth.NewConfigurationFromEnv() instead of authApi.NewConfigurationFromEnv().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

README.md Outdated
func TokenAuthExample() error {
//note: to use NewConfigurationFromEnv(), you need to previously set IONOS_TOKEN as env variables
authClient := shared.NewAPIClient(authApi.NewConfigurationFromEnv())
authClient := shared.NewAPIClient(auth.NewConfigurationFromEnv())
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example line won’t compile as written: auth.NewConfigurationFromEnv() does not exist in products/auth (only shared.NewConfigurationFromEnv() exists), and shared.NewAPIClient(...) is not a function in the shared package. Consider switching to cfg := shared.NewConfigurationFromEnv() (and then use compute.NewAPIClient(cfg)), or if you meant to call the Auth API, use auth.NewAPIClient(shared.NewConfigurationFromEnv()) and ensure the auth package is imported in this snippet.

Suggested change
authClient := shared.NewAPIClient(auth.NewConfigurationFromEnv())
cfg := shared.NewConfigurationFromEnv()

Copilot uses AI. Check for mistakes.
Replace non-existent shared.NewAPIClient(authApi.NewConfigurationFromEnv())
with shared.NewConfigurationFromEnv() and remove unused "log" import.
Copy link
Collaborator

@cristiGuranIonos cristiGuranIonos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants