Skip to content

Conversation

soberm
Copy link
Contributor

@soberm soberm commented Aug 26, 2025

Description of changes

Adds support for the defaultAuthMode parameter in REST API operations, allowing
users to control the default authentication behavior. More specifically:

• Added defaultAuthMode?: RESTAuthMode to REST API method options
• Added RESTAuthMode type definition ('none' | 'iam')
• Updated REST client to handle authentication mode

• Added global configuration support via libraryOptions.API.REST.defaultAuthMode
• Added parameter passing from public API through to REST calls
• Added validation for defaultAuthMode parameter handling
• Updated tests for new functionality

Usage

Per-request configuration:

await get({
  apiName: 'myApi', 
  path: '/public-endpoint',
  options: {
    defaultAuthMode: 'none' // Skip default IAM authentication for this request
  }
});

Global configuration:

Amplify.configure({
  // ... other config
}, {
  API: {
    REST: {
      defaultAuthMode: 'none' // Default mode for all REST calls
    }
  }
});

Issue #, if available

#14460

Description of how you validated changes

Unit tests

Checklist

  • PR description included
  • yarn test passes
  • Unit Tests are changed or added
  • Relevant documentation is changed or added (and PR referenced)

Checklist for repo maintainers

  • Verify E2E tests for existing workflows are working as expected or add E2E tests for newly added workflows
  • New source file paths included in this PR have been added to CODEOWNERS, if appropriate

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@soberm soberm marked this pull request as ready for review August 26, 2025 14:47
@soberm soberm requested a review from a team as a code owner August 26, 2025 14:47
@soberm soberm changed the title feat: add rest auth mode feat: add rest auth fallback Aug 28, 2025
@soberm soberm changed the title feat: add rest auth fallback feat: add rest default auth mode Sep 3, 2025
@soberm soberm changed the title feat: add rest default auth mode feat(api-rest): add rest default auth mode Sep 4, 2025
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.

1 participant