diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cdaaf65..8ee815d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,11 +36,11 @@ jobs: - run: go mod download - run: go build -v . - name: Run linters - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 + uses: golangci/golangci-lint-action@v6 with: - version: latest + version: v1.60 working-directory: provider - skip-pkg-cache: true + skip-cache: true scan-for-secrets: name: Scan for Secrets runs-on: ubuntu-latest diff --git a/docs/resources/ftd_device_onboarding.md b/docs/resources/ftd_device_onboarding.md index f073f00..0e3d78f 100644 --- a/docs/resources/ftd_device_onboarding.md +++ b/docs/resources/ftd_device_onboarding.md @@ -3,12 +3,12 @@ page_title: "cdo_ftd_device_onboarding Resource - cdo" subcategory: "" description: |- - This resource is meant to be in conjunction with the cdo_ftd_device resource to complete the onboarding process of an FTD to a cdFMC. The cdo_ftd_device creates an FTD device on CDO and generates a command with the registration key that should be pasted into the FTD device's CLI over SSH (see step 10 here https://docs.defenseorchestrator.com/c_onboard-an-ftd.html#!t-onboard-an-ftd-device-with-regkey.html). This resource waits for you to finish pasting the registration command, and onboards the FTD to CDO. If you are spinning up an FTDv using Terraform, you can pass the output of the cdo_ftd_device through to the FTDv. If you are using a manually deployed FTDv or a physical FTD, you cannot add this resource to your Terraform code until after you have applied the cdo_ftd_device resource, retrieved the generated_command from the resource, and pasted it into the FTD device's CLI. This resource will time out if the registration command is not applied on the FTD CLI within 30 minutes of it starting to poll. + This resource is meant to be in conjunction with the cdo_ftd_device resource to complete the onboarding process of an FTD to a cdFMC. The cdo_ftd_device creates an FTD device on CDO and generates a command with the registration key that should be pasted into the FTD device's CLI over SSH (see step 10 here https://docs.defenseorchestrator.com/c_onboard-an-ftd.html#!t-onboard-an-ftd-device-with-regkey.html). This resource waits for you to finish pasting the registration command, and onboards the FTD to CDO. If you are spinning up an FTDv using Terraform, you can pass the output of the cdo_ftd_device through to the FTDv. If you are using a manually deployed FTDv or a physical FTD, you cannot add this resource to your Terraform code until after you have applied the cdo_ftd_device resource, retrieved the generated_command from the resource, and pasted it into the FTD device's CLI. This resource will time out if the registration command is not applied on the FTD CLI within 3 minutes of it starting to poll. --- # cdo_ftd_device_onboarding (Resource) -This resource is meant to be in conjunction with the `cdo_ftd_device` resource to complete the onboarding process of an FTD to a cdFMC. The `cdo_ftd_device` creates an FTD device on CDO and generates a command with the registration key that should be pasted into the FTD device's CLI over SSH (see **step 10** [here](https://docs.defenseorchestrator.com/c_onboard-an-ftd.html#!t-onboard-an-ftd-device-with-regkey.html)). This resource waits for you to finish pasting the registration command, and onboards the FTD to CDO. If you are spinning up an FTDv using Terraform, you can pass the output of the `cdo_ftd_device` through to the FTDv. If you are using a manually deployed FTDv or a physical FTD, you cannot add this resource to your Terraform code until after you have applied the `cdo_ftd_device` resource, retrieved the `generated_command` from the resource, and pasted it into the FTD device's CLI. This resource will time out if the registration command is not applied on the FTD CLI within 30 minutes of it starting to poll. +This resource is meant to be in conjunction with the `cdo_ftd_device` resource to complete the onboarding process of an FTD to a cdFMC. The `cdo_ftd_device` creates an FTD device on CDO and generates a command with the registration key that should be pasted into the FTD device's CLI over SSH (see **step 10** [here](https://docs.defenseorchestrator.com/c_onboard-an-ftd.html#!t-onboard-an-ftd-device-with-regkey.html)). This resource waits for you to finish pasting the registration command, and onboards the FTD to CDO. If you are spinning up an FTDv using Terraform, you can pass the output of the `cdo_ftd_device` through to the FTDv. If you are using a manually deployed FTDv or a physical FTD, you cannot add this resource to your Terraform code until after you have applied the `cdo_ftd_device` resource, retrieved the `generated_command` from the resource, and pasted it into the FTD device's CLI. This resource will time out if the registration command is not applied on the FTD CLI within 3 minutes of it starting to poll. diff --git a/provider/internal/device/ftd/ftdonboarding/resource.go b/provider/internal/device/ftd/ftdonboarding/resource.go index 1b7b14f..b26f383 100644 --- a/provider/internal/device/ftd/ftdonboarding/resource.go +++ b/provider/internal/device/ftd/ftdonboarding/resource.go @@ -39,7 +39,7 @@ func (r *Resource) Schema(ctx context.Context, req resource.SchemaRequest, resp "This resource waits for you to finish pasting the registration command, and onboards the FTD to CDO. " + "If you are spinning up an FTDv using Terraform, you can pass the output of the `cdo_ftd_device` through to the FTDv. " + "If you are using a manually deployed FTDv or a physical FTD, you cannot add this resource to your Terraform code until after you have applied the `cdo_ftd_device` resource, retrieved the `generated_command` from the resource, and pasted it into the FTD device's CLI. " + - "This resource will time out if the registration command is not applied on the FTD CLI within 30 minutes of it starting to poll.", + "This resource will time out if the registration command is not applied on the FTD CLI within 3 minutes of it starting to poll.", Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ MarkdownDescription: "The unique identifier of this FTD onboarding resource, it is the registration key of the FTD.", diff --git a/provider/internal/util/togo.go b/provider/internal/util/togo.go index b983be5..40862a6 100644 --- a/provider/internal/util/togo.go +++ b/provider/internal/util/togo.go @@ -25,7 +25,7 @@ func TFStringSetToGoStringList(ctx context.Context, s types.Set) ([]string, erro stringList := make([]string, len(elements)) d := s.ElementsAs(ctx, &stringList, false) if d.HasError() { - return nil, fmt.Errorf(DiagSummary(d)) + return nil, fmt.Errorf("%s", DiagSummary(d)) } return stringList, nil } diff --git a/provider/validators/cdo_role.go b/provider/validators/cdo_role.go index 88d760a..3a9dea2 100644 --- a/provider/validators/cdo_role.go +++ b/provider/validators/cdo_role.go @@ -67,12 +67,12 @@ func extractRoleFromToken(tokenString string) (string, error) { parts := strings.Split(tokenString, ".") if len(parts) != 3 { - return "", fmt.Errorf(ErrInvalidTokenFormat) + return "", fmt.Errorf("%s", ErrInvalidTokenFormat) } payloadBytes, err := base64.RawURLEncoding.DecodeString(parts[1]) if err != nil { - return "", fmt.Errorf(ErrDecodeFailed) + return "", fmt.Errorf("%s", ErrDecodeFailed) } var claims jwt.MapClaims @@ -90,7 +90,7 @@ func extractRoleFromToken(tokenString string) (string, error) { } } - return "", fmt.Errorf(ErrNoRolesFound) + return "", fmt.Errorf("%s", ErrNoRolesFound) } // OneOfRoles checks that the JWT token roles String held in the attribute