(ctx context.Context, app, addonUUID string)
| 21 | ) |
| 22 | |
| 23 | func doesDatabaseHandleUserManagement(ctx context.Context, app, addonUUID string) (bool, error) { |
| 24 | addonsClient, err := config.ScalingoClient(ctx) |
| 25 | if err != nil { |
| 26 | return false, errors.Wrap(ctx, err, "get Scalingo client") |
| 27 | } |
| 28 | |
| 29 | isDB, err := utils.IsResourceDatabase(ctx, app) |
| 30 | if err != nil && !errors.Is(err, utils.ErrResourceNotFound) { |
| 31 | return false, errors.Wrap(ctx, err, "check if the resource is a database") |
| 32 | } |
| 33 | if isDB { |
| 34 | return true, nil |
| 35 | } |
| 36 | |
| 37 | addon, err := addonsClient.AddonShow(ctx, app, addonUUID) |
| 38 | if err != nil { |
| 39 | return false, errors.Wrap(ctx, err, "get the addon to check user management support") |
| 40 | } |
| 41 | |
| 42 | for _, supportedAddon := range SupportedAddons { |
| 43 | if strings.EqualFold(supportedAddon, addon.AddonProvider.Name) { |
| 44 | return true, nil |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | return false, nil |
| 49 | } |
| 50 | |
| 51 | func askForPasswordWithRetry(ctx context.Context, remainingRetries int) (string, string, error) { |
| 52 | if remainingRetries <= 0 { |
no test coverage detected