SMQ-3171 - Add domain ID to channel authorization request (#3179)

Signed-off-by: Felix Gateru <felix.gateru@gmail.com>
This commit is contained in:
Felix Gateru
2025-10-22 13:53:37 +03:00
committed by GitHub
parent fa8862cbc8
commit 69366d77cc
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -1010,7 +1010,7 @@ func (cr *channelRepository) CheckConnection(ctx context.Context, conn channels.
}
func (cr *channelRepository) ClientAuthorize(ctx context.Context, conn channels.Connection) error {
query := `SELECT 1 FROM connections WHERE channel_id = :channel_id AND client_id = :client_id AND type = :type LIMIT 1`
query := `SELECT 1 FROM connections WHERE channel_id = :channel_id AND client_id = :client_id AND domain_id = :domain_id AND type = :type LIMIT 1`
dbConn := toDBConnection(conn)
rows, err := cr.db.NamedQueryContext(ctx, query, dbConn)
if err != nil {
+1
View File
@@ -67,6 +67,7 @@ func (svc service) Authorize(ctx context.Context, req channels.AuthzReq) error {
case policies.ClientType:
// Optimization: Add cache
if err := svc.repo.ClientAuthorize(ctx, channels.Connection{
DomainID: req.DomainID,
ChannelID: req.ChannelID,
ClientID: req.ClientID,
Type: req.Type,