Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New APIG custom authorizer resource supported #1297

Merged
merged 2 commits into from
Jul 27, 2021
Merged

New APIG custom authorizer resource supported #1297

merged 2 commits into from
Jul 27, 2021

Conversation

Lance52259
Copy link
Collaborator

@Lance52259 Lance52259 commented Jul 19, 2021

What this PR does / why we need it:
A mechanism defined with custom rules for API Gateway to verify the validity and integrity of requests initiated by API callers. The mechanism is also used for backend services to verify the requests forwarded by API Gateway.
The following two types of custom authentication are provided:

  • Frontend custom authentication: A custom authorizer is configured with a function to authenticate requests for an API.
  • Backend custom authentication: A custom authorizer can be configured to authenticate requests for different backend services, eliminating the need to customize APIs for different authentication systems and simplifying API development. You only need to create a function-based custom authorizer in API Gateway to connect to the backend authentication system.

Which issue this PR fixes:
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)
reference: #1249

Special notes for your reviewer:

Release note:

1. New custom authorizer resource, which support fornt and backend auth management.
2. Related acc unit test supported.
3. New document supported.

PR Checklist

  • Tests added/passed.
  • Documentation updated.
  • Schema updated.

Acceptance Steps Performed

make testacc TEST='./huaweicloud/services/acceptance/apig' TESTARGS='-run=TestAccApigCustomAuthorizerV2_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./huaweicloud/services/acceptance/apig -v -run=TestAccApigCustomAuthorizerV2_basic -timeout 360m -parallel 4
=== RUN   TestAccApigCustomAuthorizerV2_basic
=== PAUSE TestAccApigCustomAuthorizerV2_basic
=== CONT  TestAccApigCustomAuthorizerV2_basic
--- PASS: TestAccApigCustomAuthorizerV2_basic (475.90s)
PASS
ok      github.com/huaweicloud/terraform-provider-huaweicloud/huaweicloud/services/acceptance/apig      475.968s

@Lance52259 Lance52259 changed the title New apig custom authorizer resource support New APIG custom authorizer resource support Jul 19, 2021
@Lance52259 Lance52259 changed the title New APIG custom authorizer resource support New APIG custom authorizer resource supported Jul 19, 2021
@Lance52259
Copy link
Collaborator Author

Pending sdk supports custom authorizaiton.

Required: true,
ForceNew: true,
ValidateFunc: validation.StringMatch(
regexp.MustCompile("^[A-Za-z][\\w0-9]{2,63}$"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest to use ^[A-Za-z][\\w]{2,63}$ for more conciseness.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, the \w contain 0-9.

@ShiChangkuo ShiChangkuo merged commit 22cbe28 into huaweicloud:master Jul 27, 2021
@Lance52259 Lance52259 deleted the br_custom_authorization_active branch August 31, 2021 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants