Skip to content

Conversation

@aishkan
Copy link
Contributor

@aishkan aishkan commented Oct 22, 2025

💐

/cc @zendesk/wattle

Description

Add validation for scopes attribute for secure param.
Validations added are as follows

  • scopes can be nil
  • scopes can't be empty []
  • scopes can only be present when secure true is set on the attribute
  • The validation of scope is based on validate_scopes_for_secure_parameter passed in param

References

https://zendesk.atlassian.net/browse/APPS-7700

Risks

  • [RUNTIME] Can this change affect apps rendering for a user? No
  • [ low] Can break app validations

@aishkan aishkan changed the title Add validation for scopes attribute for secure param [APPS-7700] Add validation for scopes attribute for secure param Oct 22, 2025
@aishkan aishkan marked this pull request as ready for review October 22, 2025 22:14
@aishkan aishkan requested a review from a team as a code owner October 22, 2025 22:14
Copilot AI review requested due to automatic review settings October 22, 2025 22:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds validation for the scopes attribute on secure parameters in app manifests. The validation ensures scopes are only used with secure parameters, cannot be empty arrays, and contain only valid scope values from a predefined list.

Key Changes:

  • Added validate_scopes_for_secure_parameter flag to control scope validation
  • Implemented three validation rules: scopes require secure=true, scopes cannot be empty, and scopes must be from allowed values
  • Added comprehensive test coverage for all validation scenarios

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
lib/zendesk_apps_support/validations/manifest.rb Implements scope validation logic with three new error checks and adds SECURE_PARAM_SCOPES constant
lib/zendesk_apps_support/manifest/parameter.rb Adds scopes to parameter attributes to support reading scope configuration
spec/validations/manifest_spec.rb Adds comprehensive test coverage for scope validation scenarios including edge cases
config/locales/translations/zendesk_apps_support.yml Adds translation keys for three new validation error messages
config/locales/en.yml Adds English text for the three new validation error messages

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 1fc8a24 to c5c1530 Compare October 27, 2025 23:24
Copilot AI review requested due to automatic review settings October 28, 2025 01:04
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from c5c1530 to eaa1381 Compare October 28, 2025 01:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from eaa1381 to 1a093cb Compare October 28, 2025 01:12
Copilot AI review requested due to automatic review settings October 28, 2025 01:24
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 1a093cb to 7f2d771 Compare October 28, 2025 01:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 7f2d771 to 8adf80d Compare October 28, 2025 01:30
Copilot AI review requested due to automatic review settings October 28, 2025 03:45
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 8adf80d to d50c805 Compare October 28, 2025 03:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from d50c805 to 866fd65 Compare October 29, 2025 00:11
Copilot AI review requested due to automatic review settings October 29, 2025 04:11
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 866fd65 to a40095b Compare October 29, 2025 04:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from a40095b to 9835af9 Compare October 29, 2025 04:13
Copilot AI review requested due to automatic review settings October 29, 2025 04:26
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 9835af9 to acdef7c Compare October 29, 2025 04:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from acdef7c to 99670c9 Compare October 29, 2025 04:32
Copilot AI review requested due to automatic review settings October 29, 2025 04:59
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 99670c9 to 07d926b Compare October 29, 2025 04:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 16d174a to 3878082 Compare October 31, 2025 01:03
Copilot AI review requested due to automatic review settings October 31, 2025 02:16
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 3878082 to 04bdf10 Compare October 31, 2025 02:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

spec/validations/manifest_spec.rb:10

  • Corrected spelling of 'default ocale' to 'default locale'.
      'defaultLocale' => 'default ocale',

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 04bdf10 to bf1777a Compare October 31, 2025 03:06
Copilot AI review requested due to automatic review settings October 31, 2025 03:59
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from bf1777a to afb8085 Compare October 31, 2025 03:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from afb8085 to 82fe811 Compare November 2, 2025 22:26
Copilot AI review requested due to automatic review settings November 2, 2025 23:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@mmassaki mmassaki left a comment

Choose a reason for hiding this comment

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

Thank you for addressing my comments.

I approve with a minor comment.

@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from 598e3ae to fb211ae Compare November 3, 2025 00:36
Copilot AI review requested due to automatic review settings November 3, 2025 03:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

value: "Password parameter type can no longer be used. Use Secure settings instead. Learn more: %{link}."
- translation:
key: "txt.apps.admin.error.app_build.field_requires_secure_parameter"
title: "App builder job: scopes can be defined only on secure parameters"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please provide context for %{field} and the other placeholders so linguists can translate them? Thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hiroiguchi I have added the context now

@hiroiguchi hiroiguchi added the g11n-commented Commented by Globalization label Nov 3, 2025
@aishkan aishkan force-pushed the aishkan/secure-settings-scope branch from b540df1 to cef6f7a Compare November 5, 2025 02:35
Copy link
Contributor

@hiroiguchi hiroiguchi left a comment

Choose a reason for hiding this comment

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

👌 for string

@hiroiguchi hiroiguchi added g11n-approved Approved by Globalization and removed g11n-commented Commented by Globalization labels Nov 5, 2025
@aishkan aishkan merged commit 4c7f570 into main Nov 5, 2025
8 checks passed
@aishkan aishkan deleted the aishkan/secure-settings-scope branch November 5, 2025 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

g11n-approved Approved by Globalization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants