-
Notifications
You must be signed in to change notification settings - Fork 18
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
Getting an error as column 'id' requires hydrate data from getKeyVaultSecret but none is available on azure_key_vault_secret table. Closes #104 #111
Conversation
…tSecret but none is available on azure_key_vault_secret table. Closes #104
if !*data.Attributes.Enabled { | ||
return nil, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will happen if someone has passed quals to make GET call, i.e. select * from azure_key_vault_secret where name = 'secret123' and vault_name = 'vault123'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anisadas I have left a comment. Can you please verify the GET function and try to query the table with the quals required for GET call?
@Subhajit97 I already mentioned in this issue that GET operation is not allowed on disable secret if someone tries to query
This query works only on enable secret. |
Yes, but if someone runs a query without knowing the resource state, it should not return any error.
Instead of returning error, we should safely handle this error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -21,7 +21,7 @@ func tableAzureKeyVaultSecret(_ context.Context) *plugin.Table { | |||
Get: &plugin.GetConfig{ | |||
KeyColumns: plugin.AllColumns([]string{"vault_name", "name"}), | |||
Hydrate: getKeyVaultSecret, | |||
ShouldIgnoreError: isNotFoundError([]string{"ResourceNotFound", "404"}), | |||
ShouldIgnoreError: isNotFoundError([]string{"ResourceNotFound", "404", "403"}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What else can give us 403 errors from the getKeyVaultSecret
function? If we have incorrect permissions, do we also get a 403 error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes when wrong access policy set on vault in that time also get 403 error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anisadas Can you please try looking for the Operation get is not allowed on a disabled secret.
error message instead of the 403 error code, as we don't want to ignore all permission errors for the get operation.
Integration test logs
Logs
Example query results
Results