Closed petew-nfx closed 7 months ago
hi @petew-nfx , thankns for reporting the access zone issues. I'm clear about the first issue - unable to add non-file based auth providers, and will solve it in our plan. And for the order of auth providers matters, you mean the order of auth_providers should be same to custom_auth_providers ?
In regards to auth_providers I was emphasizing the point made in the PowerScale OneFS CLI Administration Guide: The order in which authentication providers are added to access zone designates the order in which providers are searched during authentication and user lookup.
The custom_auth_providers is missing the lsa-local-provider:
hi @petew-nfx , according to the doc, the custom_auth_providers
is used for adding or removing auth_providers to the access zone, the access zone also has one filed auth_providers
to specifies the list of authentication providers available on this access zone, and we can focus on its order.
auth_providers
is a read-only attribute which prevents using it in a tf file. custom_auth_providers
is derived from auth_providers
hi @petew-nfx , the code you pointed to is only used in import function; in create and update function, we use custom_auth_providers
to modify auth providers, not derived from auth_providers. And custom_auth_providers
order is decided by user.
Yes, the code I pointed to showed how custom_auth_providers
is derived from auth_providers
by removing the "main" provider (based on zone name). If the custom_auth_providers
lacks the zone provider, it cannot be used for arbitrary ordering of providers. Is there a reason for not using auth_providers
directly?
hi @petew-nfx . yes, the the custom_auth_providers
is used to overcome the limitation on the PowerScale API due to the automatic local-provider being created that we cannot order the automatically created provider. Since sending that in the PUT or POST request adds a failure.
And you can still be able to order the other providers using the custom provider.
Passing the local-provider does not result in failure. In fact isi zone zones modify <zone-name> --auth-providers=<provider-list>
requires a full list of providers, including the local-provider for the zone.
Passing --debug
to the command shows that a PUT to 3/zones/<zone-name>
with the local-provider succeeds.
Going through all possible permutations of the provides order shows there is no restriction on ordering.
@petew-nfx To order providers, In custom_auth_providers
, you can input your all providers including the automatic local-provider for the zone. Some user may not input the automatic local-provider to provider list, if we merge custom_auth_providers
and auth_providers
to one, this may result to terraform state mismatch and throw exception.
And if need more detailed information, if possible, we may schedule a meeting to discuss this issue through zoom or other ways. Thanks.
It seems the use of custom_auth_providers
is unnecessary . If all entries are to be supplied and also in order, then auth_providers
could be used. Ensuring the existence of lsa-local-provider:<zone>
in the list chould be a validation step.
hi @petew-nfx , if user input["lsa-local-provider:System"]
to auth_providers
, the response should be["lsa-local-provider:System", ""lsa-local-provider:yourAutomaticProvider]
, this will result to the planed value are mismatched to the response state and the terraform will report exception. So it's useful to use custom_auth_providers
for input separately.
Close per PR 127 merged.
Bug Description
AccessZoneResource.custom_auth_providers is created by converting the fully qualified name to a short name, by splitting on ":" and taking the second element. Remove entries from custom_auth_providers works, but adding them back fails. This is due to "lsa-file-provider" being hard coded to fully qualify the custom entry. It is also important to remember that the order of auth providers matters, as that determines lookup order.
Resource or DataSource Name
AccessZone
Terraform Version
Terraform 1.6.6
OneFS Version
9.4.0.13
go Version
go 1.21.5
Unisphere Version
N/A
Operating System
MacOS Darwin Kernel Version 23.2.0
Terraform File Used
Initial file
Commented out file
State
Logs
Steps to Reproduce
Expected Behavior
Auth providers defined on the cluster should be able to be added/removed from an AccessZone via terraform apply.
Actual Behavior
Auth providers defined on the cluster can be removed from an AccessZone, but can only be added if they are an lsa-file-provider
Screenshots
No response
Additional Information
No response