Skip to content

feat: Website SSL DNS Type support WestCN#8305

Merged
f2c-ci-robot[bot] merged 1 commit intodevfrom
pr@dev@common
Apr 2, 2025
Merged

feat: Website SSL DNS Type support WestCN#8305
f2c-ci-robot[bot] merged 1 commit intodevfrom
pr@dev@common

Conversation

@zhengkunwang223
Copy link
Copy Markdown
Member

No description provided.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 2, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

p, err = westcn.NewDNSProviderConfig(westcnConfig)
}
if err != nil {
return err
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The code appears to be adding support for the West Cloud service provider, including configuring it using new parameters from the param struct. It adds methods to initialize a West Cloud-specific DNS provider with authentication details.

Here's an example of how you might use this function:

// Create a parameter object with necessary credentials and TTL value
params := &DNSParam{
    AuthID:       "your_auth_id",
    SubAuthID:    "your_sub_auth_id",
    AuthPassword: "your_password",
    Username:     "westcloud_username",  // New field required specifically for West Cloud
}

// Initialize AcmeClient and set DnsType to WestCN
acmeClient.UseDns(WestCN, json.Marshal(params).String(), model.WebsiteSSL)

// Wait for DNS records to propagate (optional)
time.Sleep(runningTime.Duration(time.Second))

This setup ensures that your Acme client can handle West Cloud specific requirements effectively after being initialized with proper configuration details.

if (!account.value.authorization['authID'] && !account.value.authorization['subAuthID']) {
MsgError('Please input Auth ID or Sub Auth ID');
return;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The provided code changes look generally consistent with the intended functionality. Here are some observations:

  1. New Conditional Formatting for WestCN Type:

    • A new <div> block is conditionally rendered when account.type equals 'WestCN'.
    • This includes two additional form fields:
      • One field labeled "Username"
      • One field labeled "Password"
    • These fields use v-model to bind their values to account.authorization['username'] and account.authorization['password'], respectively.

    The addition of these fields aligns with adding support for WestCN-specific authentication requirements.

  2. Validation Rules Update (Line 230):

    • There's an updated validation rule for rules.account. Specifically, it added a rule for Rules.username, allowing users to enter a username.
    • This update ensures that all necessary forms meet proper user input validity checks across different account types.

These changes improve the application's flexibility by handling different authentication methods based on customer type (WestCN) while maintaining consistency in data binding and validation logic.

Overall, the changes seem well-planned and should work smoothly without major issues when implemented.

},
];

export const Fields = [
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes look mostly correct but there are a couple of suggestions for improvement:

  1. Spacing Consistency: Ensure consistent spacing around operators and curly braces to improve readability.

  2. Comments for New Entries: It's good practice to add comments explaining why you've added new entries if it enhances understanding or maintainability.

Here’s an optimized version with minor adjustments:

@@ -212,6 +212,10 @@
     label: i18n.global.t('website.rainyun'),
     value: 'RainYun',
 },

+// WestCN is another DNS service provider available.
+{
+    label: i18n.global.t('website.westCN'),
+    value: 'WestCN',
+},

These changes introduce clearer spacing and a brief comment in case someone reading the code later needs more context on the inclusion of WestCN as a DNS service provider.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Apr 2, 2025

Copy link
Copy Markdown
Member

@wanghe-fit2cloud wanghe-fit2cloud left a comment

Choose a reason for hiding this comment

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

/lgtm

@wanghe-fit2cloud
Copy link
Copy Markdown
Member

/approve

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot Bot commented Apr 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: wanghe-fit2cloud

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot Bot added the approved label Apr 2, 2025
@f2c-ci-robot f2c-ci-robot Bot merged commit 3437d62 into dev Apr 2, 2025
6 checks passed
@f2c-ci-robot f2c-ci-robot Bot deleted the pr@dev@common branch April 2, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants