mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 03:24:26 +00:00
fix(oidc): make device auth audience and scope nullable (#7777)
This fixes the projection of events that have a null audience or scope.
As audience was added in v2.50, legacy events do not have an audience, this made replay of the old events not possible after an upgrade.
(cherry picked from commit be00e3861a
)
This commit is contained in:
parent
905799c736
commit
86e6c2a5df
@ -169,15 +169,15 @@ func TestQueries_DeviceAuthByDeviceCode(t *testing.T) {
|
||||
|
||||
const (
|
||||
expectedDeviceAuthQueryC = `SELECT` +
|
||||
` projections.device_auth_requests1.client_id,` +
|
||||
` projections.device_auth_requests1.device_code,` +
|
||||
` projections.device_auth_requests1.user_code,` +
|
||||
` projections.device_auth_requests1.scopes,` +
|
||||
` projections.device_auth_requests1.audience` +
|
||||
` FROM projections.device_auth_requests1`
|
||||
` projections.device_auth_requests2.client_id,` +
|
||||
` projections.device_auth_requests2.device_code,` +
|
||||
` projections.device_auth_requests2.user_code,` +
|
||||
` projections.device_auth_requests2.scopes,` +
|
||||
` projections.device_auth_requests2.audience` +
|
||||
` FROM projections.device_auth_requests2`
|
||||
expectedDeviceAuthWhereUserCodeQueryC = expectedDeviceAuthQueryC +
|
||||
` WHERE projections.device_auth_requests1.instance_id = $1` +
|
||||
` AND projections.device_auth_requests1.user_code = $2`
|
||||
` WHERE projections.device_auth_requests2.instance_id = $1` +
|
||||
` AND projections.device_auth_requests2.user_code = $2`
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DeviceAuthRequestProjectionTable = "projections.device_auth_requests1"
|
||||
DeviceAuthRequestProjectionTable = "projections.device_auth_requests2"
|
||||
|
||||
DeviceAuthRequestColumnClientID = "client_id"
|
||||
DeviceAuthRequestColumnDeviceCode = "device_code"
|
||||
@ -44,8 +44,8 @@ func (*deviceAuthRequestProjection) Init() *old_handler.Check {
|
||||
handler.NewColumn(DeviceAuthRequestColumnClientID, handler.ColumnTypeText),
|
||||
handler.NewColumn(DeviceAuthRequestColumnDeviceCode, handler.ColumnTypeText),
|
||||
handler.NewColumn(DeviceAuthRequestColumnUserCode, handler.ColumnTypeText),
|
||||
handler.NewColumn(DeviceAuthRequestColumnScopes, handler.ColumnTypeTextArray),
|
||||
handler.NewColumn(DeviceAuthRequestColumnAudience, handler.ColumnTypeTextArray),
|
||||
handler.NewColumn(DeviceAuthRequestColumnScopes, handler.ColumnTypeTextArray, handler.Nullable()),
|
||||
handler.NewColumn(DeviceAuthRequestColumnAudience, handler.ColumnTypeTextArray, handler.Nullable()),
|
||||
handler.NewColumn(DeviceAuthRequestColumnCreationDate, handler.ColumnTypeTimestamp),
|
||||
handler.NewColumn(DeviceAuthRequestColumnChangeDate, handler.ColumnTypeTimestamp),
|
||||
handler.NewColumn(DeviceAuthRequestColumnSequence, handler.ColumnTypeInt64),
|
||||
|
Loading…
Reference in New Issue
Block a user