Skip to content

Commit

Permalink
linting, remove manning annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
tedivm committed Sep 22, 2024
1 parent 5b3dabe commit c9824f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,14 @@ func (p *MastodonProvider) Configure(ctx context.Context, req provider.Configure
tflog.Debug(ctx, "mastodon_provider current user: "+user.Acct)

if access_token != "" {
ctx = tflog.SetField(ctx, "mastodon_access_token", access_token) //ANNO We can log the access token to help with debugging.
ctx = tflog.MaskFieldValuesWithFieldKeys(ctx, "mastodon_access_token") //ANNO We can also make sure to filter out the value from the logs.
ctx = tflog.SetField(ctx, "mastodon_access_token", access_token)
tflog.MaskFieldValuesWithFieldKeys(ctx, "mastodon_access_token")
} else if user_email != "" && user_password != "" {
ctx = tflog.SetField(ctx, "mastodon_user_email", user_email)
ctx = tflog.SetField(ctx, "mastodon_user_password", user_password)
ctx = tflog.MaskFieldValuesWithFieldKeys(ctx, "mastodon_user_password")
tflog.MaskFieldValuesWithFieldKeys(ctx, "mastodon_user_password")
} else {
resp.Diagnostics.AddAttributeError( //ANNO We can provide more than one error on the same flow.
resp.Diagnostics.AddAttributeError(
path.Root("user-access-token"),
"Missing Mastodon Credentials",
"The provider cannot create the Mastodon API client as neither the Access Token or the Username and Password fields are set.",
Expand Down

0 comments on commit c9824f0

Please sign in to comment.