Skip to content

feat: add session_cookie_domain and session_cookie_path to ory_project_config#77

Open
KT-Doan wants to merge 1 commit intomainfrom
feat/session-cookie-domain-path
Open

feat: add session_cookie_domain and session_cookie_path to ory_project_config#77
KT-Doan wants to merge 1 commit intomainfrom
feat/session-cookie-domain-path

Conversation

@KT-Doan
Copy link
Collaborator

@KT-Doan KT-Doan commented Feb 26, 2026

Description

Adds two new optional attributes to the ory_project_config resource:

  • session_cookie_domain — Sets the domain for session cookies, enabling cookie sharing across subdomains (e.g., .example.com)
  • session_cookie_path — Sets the path for session cookies (e.g., /)

These map to the Ory Kratos config at /services/identity/config/session/cookie/domain and /services/identity/config/session/cookie/path.

Related Issues

Fixes #76

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING guide
  • My code follows the existing code style
  • I have added tests that prove my fix/feature works
  • I have updated documentation as needed
  • All new and existing tests pass (make test)
  • I have run the linter (make format)

Testing

Describe how you tested these changes:

  • Unit tests
  • Acceptance tests — TestAccProjectConfigResource_sessionCookie with create + update steps
  • Manual testing — plan, apply, re-plan (no drift), update, destroy against staging API

Screenshots/Output

N/A — all changes are backend resource attributes with no UI component.

…t_config

Add support for configuring session cookie domain and path in the
ory_project_config resource. This enables sharing session cookies
across subdomains (e.g., '.example.com') and restricting cookie paths.

Closes #76
Copilot AI review requested due to automatic review settings February 26, 2026 16:17
Copy link
Contributor

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

Adds support in the Terraform ory_project_config resource for configuring Ory Kratos session cookie domain and path, enabling cross-subdomain session sharing and path scoping, with accompanying docs and acceptance coverage.

Changes:

  • Add optional session_cookie_domain and session_cookie_path attributes to the ory_project_config resource schema/model and map them to the corresponding Kratos config JSON patch paths.
  • Extend project config read/refresh logic to track these attributes for drift detection when configured.
  • Add acceptance test coverage plus documentation and example updates.

Reviewed changes

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

Show a summary per file
File Description
internal/resources/projectconfig/resource.go Adds new schema/model fields and wires them into patch building + state refresh from API config.
internal/resources/projectconfig/resource_test.go Adds an acceptance test covering create + update for the new session cookie attributes.
internal/resources/projectconfig/testdata/session_cookie.tf.tmpl Acceptance test config template for initial create step.
internal/resources/projectconfig/testdata/session_cookie_updated.tf.tmpl Acceptance test config template for update step.
docs/resources/project_config.md Updates generated resource docs with new attributes and example usage.
templates/resources/project_config.md.tmpl Updates the docs template to include the new session cookie settings in the category overview.
examples/resources/ory_project_config/resource.tf Updates example configuration to demonstrate the new attributes.

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

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.

Provider does not seem to support session.cookie.domain

2 participants