fix: removed deprecated hashing functions
@@ -9,7 +9,6 @@ import (
"github.com/microsoft/azure-devops-go-api/azuredevops/v6/serviceendpoint"
"github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/utils/converter"
- "github.com/microsoft/terraform-provider-azuredevops/azuredevops/internal/utils/tfhelper"
)
const (
@@ -36,8 +35,6 @@ func ResourceServiceEndpointExternalTFS() *schema.Resource {
},
},
}
- patHashKey, patHashSchema := tfhelper.GenerateSecreteMemoSchema(personalAccessTokenExternalTFS)
- authPersonal.Schema[patHashKey] = patHashSchema
r.Schema["auth_personal"] = &schema.Schema{
Type: schema.TypeSet,
MinItems: 1,
@@ -84,28 +81,12 @@ func flattenServiceEndpointExternalTFS(
doBaseFlattening(d, serviceEndpoint, projectID)
if strings.EqualFold(*serviceEndpoint.Authorization.Scheme, "Token") {
- authPersonalSet := d.Get("auth_personal").(*schema.Set).List()
- authPersonal := flattenAuthPersonExternalTFS(d, authPersonalSet)
- if authPersonal != nil {
- d.Set("auth_personal", authPersonal)
- }
+ d.Set("auth_personal", &[]map[string]interface{}{
+ {
+ personalAccessTokenExternalTFS: (*serviceEndpoint.Authorization.Parameters)["apitoken"],
+ },
+ })
}
d.Set("connection_url", *serviceEndpoint.Url)
}
-
-func flattenAuthPersonExternalTFS(d *schema.ResourceData, authPersonalSet []interface{}) []interface{} {
- if len(authPersonalSet) == 1 {
- if authPersonal, ok := authPersonalSet[0].(map[string]interface{}); ok {
- newHash, hashKey := tfhelper.HelpFlattenSecretNested(
- d,
- "auth_personal",
- authPersonal,
- personalAccessTokenExternalTFS,
- )
- authPersonal[hashKey] = newHash
- return []interface{}{authPersonal}
- }
- }
- return nil
-}
