Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions service/integration/subject_mappings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,17 @@ func (s *SubjectMappingsSuite) Test_ListSubjectMappings_NoPagination_Succeeds()
for _, sm := range listed {
if sm.GetId() == fixture1.ID {
assertEqual(sm, fixture1)
s.Equal("https://example.com/attr/attr1/value/value1", sm.GetAttributeValue().GetFqn())
found1 = true
}
if sm.GetId() == fixture2.ID {
assertEqual(sm, fixture2)
s.Equal("https://example.com/attr/attr1/value/value2", sm.GetAttributeValue().GetFqn())
found2 = true
}
if sm.GetId() == fixture3.ID {
assertEqual(sm, fixture3)
s.Equal("https://example.com/attr/attr1/value/value1", sm.GetAttributeValue().GetFqn())
found3 = true
}
}
Expand Down
10 changes: 8 additions & 2 deletions service/policy/db/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -839,13 +839,19 @@ SELECT
'metadata', JSON_STRIP_NULLS(JSON_BUILD_OBJECT('labels', scs.metadata->'labels', 'created_at', scs.created_at, 'updated_at', scs.updated_at)),
'subject_sets', scs.condition
) AS subject_condition_set,
JSON_BUILD_OBJECT('id', av.id,'value', av.value,'active', av.active) AS attribute_value,
JSON_BUILD_OBJECT(
'id', av.id,
'value', av.value,
'active', av.active,
'fqn', fqns.fqn
) AS attribute_value,
counted.total
FROM subject_mappings sm
CROSS JOIN counted
LEFT JOIN attribute_values av ON sm.attribute_value_id = av.id
LEFT JOIN attribute_fqns fqns ON av.id = fqns.value_id
LEFT JOIN subject_condition_set scs ON scs.id = sm.subject_condition_set_id
GROUP BY av.id, sm.id, scs.id, counted.total
GROUP BY av.id, sm.id, scs.id, counted.total, fqns.fqn
LIMIT @limit_
OFFSET @offset_;

Expand Down
10 changes: 6 additions & 4 deletions service/policy/db/query.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading