SAP / terraform-provider-btp

Terraform provider for SAP BTP
https://registry.terraform.io/providers/SAP/btp/latest
Apache License 2.0
91 stars 18 forks source link

feat: Resource to manage XSUAA Api Credentials #893

Closed diya-dhan closed 3 months ago

diya-dhan commented 3 months ago

Purpose

fix #689

The BTP CLI supports managing API credentials for the SAP Authorization and Trust Management (XSUAA) service, enabling users to interact programmatically with REST APIs. These APIs facilitate the management of entities and user provisioning across subaccounts, global accounts, or directories.

The provider now has introduced new resources to manage these API credentials at various levels: subaccount, global account, and directory. Users can create credentials of either the certificate type (currently, certificates can only be provided as strings) or the secret type. The state file will store the client secret or certificate key information for reference when using these APIs.

Please note that updating credentials is not supported by this resource, as there is currently no API available for this purpose.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

go test ./...

What to Check

Verify that the following are valid:

Checklist for reviewer

The following organizational tasks must be completed before merging this PR:

lechnerc77 commented 3 months ago

Sonar Cloud Quality check is accepted to be below 80%

diya-dhan commented 3 months ago

Some minor changes requested for import documentation

General question: there are no data sources available. This is due to the fact that the returned data is only a fraction of the complete data and we leave it out?

Yes, like you mentioned the GET call does not return a lot of the information that is relevant to the user. This is only known at the time the api credentials are created. Additionally, as of now, there is no use case where the api credentials can be used in other BTP resources, due to which a datasource for it didn't really make sense.