Skip to content

Conversation

@darcyYe
Copy link
Contributor

@darcyYe darcyYe commented Dec 8, 2025

Summary

update saml_application_sessions relay_state col type
Previously, the relay_state could only accept values with a length of up to 256 characters. However, some service providers have longer values, which would cause errors in the database write queries, thereby blocking the entire SAML authentication process and leading to failure. In this update, we have changed the column type of relay_state to text to support relay_state values of any length.
Will add changeset in later PR.

Testing

N/A

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@github-actions
Copy link

github-actions bot commented Dec 8, 2025

COMPARE TO master

Total Size Diff 📈 +2.85 KB

Diff by File
Name Diff
packages/core/src/middleware/koa-slonik-error-handler.ts 📈 +940 Bytes
packages/core/src/routes/saml-application/anonymous.ts 📈 +597 Bytes
packages/phrases/src/locales/ar/errors/entity.ts 📈 +84 Bytes
packages/phrases/src/locales/de/errors/entity.ts 📈 +78 Bytes
packages/phrases/src/locales/en/errors/entity.ts 📈 +76 Bytes
packages/phrases/src/locales/es/errors/entity.ts 📈 +83 Bytes
packages/phrases/src/locales/fr/errors/entity.ts 📈 +85 Bytes
packages/phrases/src/locales/it/errors/entity.ts 📈 +81 Bytes
packages/phrases/src/locales/ja/errors/entity.ts 📈 +82 Bytes
packages/phrases/src/locales/ko/errors/entity.ts 📈 +82 Bytes
packages/phrases/src/locales/pl-pl/errors/entity.ts 📈 +79 Bytes
packages/phrases/src/locales/pt-br/errors/entity.ts 📈 +78 Bytes
packages/phrases/src/locales/pt-pt/errors/entity.ts 📈 +78 Bytes
packages/phrases/src/locales/ru/errors/entity.ts 📈 +111 Bytes
packages/phrases/src/locales/th/errors/entity.ts 📈 +133 Bytes
packages/phrases/src/locales/tr-tr/errors/entity.ts 📈 +71 Bytes
packages/phrases/src/locales/zh-cn/errors/entity.ts 📈 +58 Bytes
packages/phrases/src/locales/zh-hk/errors/entity.ts 📈 +58 Bytes
packages/phrases/src/locales/zh-tw/errors/entity.ts 📈 +58 Bytes
packages/schemas/alterations/next-1765255453-update-saml-session-relay-state-to-varchar-512.ts 📈 +1.17 KB
packages/schemas/tables/saml_application_sessions.sql 0 Bytes

@darcyYe darcyYe changed the title fix: update saml_application_sessions relay_state col type fix: update saml_application_sessions relay_state and saml_request_id cols type Dec 8, 2025
@github-actions github-actions bot added size/s and removed size/s labels Dec 8, 2025
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

This PR addresses a database schema limitation in the saml_application_sessions table where the relay_state column with a 256-character limit was causing SAML authentication failures for service providers using longer relay state values.

Key Changes:

  • Updated relay_state column type from varchar(256) to text to support arbitrary-length relay state values
  • Added database migration script to alter the column type
  • Enhanced error messages in SAML authentication endpoints to provide better debugging context

Reviewed changes

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

File Description
packages/schemas/tables/saml_application_sessions.sql Updates table schema definition to change relay_state column from varchar(256) to text
packages/schemas/alterations/next-1765186571-update-saml-session-relay-state-to-text.ts Adds migration script to alter the relay_state column type with up/down operations
packages/core/src/routes/saml-application/anonymous.ts Improves error messages in both GET and POST SAML authentication endpoints by including underlying error details

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

@darcyYe darcyYe changed the title fix: update saml_application_sessions relay_state and saml_request_id cols type fix: update saml_application_sessions cols type Dec 8, 2025
@github-actions github-actions bot added size/s and removed size/s labels Dec 8, 2025
@darcyYe darcyYe changed the title fix: update saml_application_sessions cols type fix: update saml_application_sessions col type Dec 8, 2025
@darcyYe darcyYe force-pushed the yemq-update-saml-application-sessions-relay-state-col branch from 8d6a373 to 271eb18 Compare December 9, 2025 04:45
@github-actions github-actions bot added size/l and removed size/m labels Dec 9, 2025
@darcyYe darcyYe merged commit ed2098d into master Dec 9, 2025
36 checks passed
@darcyYe darcyYe deleted the yemq-update-saml-application-sessions-relay-state-col branch December 9, 2025 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants