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: 0 additions & 3 deletions sdk/granter.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,6 @@ func newGranterFromService(ctx context.Context, logger *slog.Logger, keyCache *k

av, err := as.GetAttributeValuesByFqns(ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqnsStr,
WithValue: &policy.AttributeValueSelector{
WithKeyAccessGrants: true,
},
})
if err != nil {
return granter{}, err
Expand Down
3 changes: 0 additions & 3 deletions service/authorization/authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,6 @@ func retrieveAttributeDefinitions(ctx context.Context, attrFqns []string, sdk *o
}

resp, err := sdk.Attributes.GetAttributeValuesByFqns(ctx, &attr.GetAttributeValuesByFqnsRequest{
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: false,
},
Fqns: attrFqns,
})
if err != nil {
Expand Down
51 changes: 0 additions & 51 deletions service/integration/attribute_fqns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -981,9 +981,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns() {
fqns := []string{fqn1}
attributeAndValue, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)

Expand All @@ -1009,9 +1006,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns() {
fqns = []string{fqn1, fqn2}
attributeAndValue, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)
s.Len(attributeAndValue, 2)
Expand Down Expand Up @@ -1066,9 +1060,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_NormalizesLowerCase() {
fqns := []string{upperNsFqn1}
attributeAndValue, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)

Expand Down Expand Up @@ -1100,9 +1091,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_NormalizesLowerCase() {
fqns = []string{upperNsFqn1, upperNsFqn2}
attributeAndValue, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)
s.Len(attributeAndValue, 2)
Expand Down Expand Up @@ -1164,9 +1152,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_AllValuesHaveProperFqns
fqns := []string{fqn1}
attributeAndValues, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)

Expand Down Expand Up @@ -1199,9 +1184,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_AllValuesHaveProperFqns
fqns = []string{fqn1, fqn2, fqn3}
attributeAndValues, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)
s.Len(attributeAndValues, 3)
Expand Down Expand Up @@ -1269,9 +1251,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_WithDeactivatedNa
// get the attribute by the value fqn for v1
v, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v1.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(v)
Expand All @@ -1280,9 +1259,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_WithDeactivatedNa
// get the attribute by the value fqn for v2
v, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v2.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(v)
Expand Down Expand Up @@ -1321,9 +1297,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_WithDeactivatedAt
// get the attribute by the value fqn for v1
v, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v1.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(v)
Expand All @@ -1332,9 +1305,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_WithDeactivatedAt
// get the attribute by the value fqn for v2
v, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v2.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(v)
Expand Down Expand Up @@ -1370,9 +1340,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_WithDeactivatedAt
// get the attribute by the value fqn for v1
v, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v1.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(v)
Expand All @@ -1381,9 +1348,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_WithDeactivatedAt
// get the attribute by the value fqn for v2
v, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v2.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)
s.NotNil(v)
Expand Down Expand Up @@ -1423,9 +1387,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_InactiveDef_Activ
// get the attribute by the value fqn for v1
retrieved, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v1.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(retrieved)
Expand Down Expand Up @@ -1466,9 +1427,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_InactiveNsAndDef_
// get the attribute by the value fqn for v1
retrieved, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(ns.GetName(), attr.GetName(), v1.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(retrieved)
Expand Down Expand Up @@ -1516,9 +1474,6 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_ActiveDef_Inactiv
// get the attribute by the value fqn for v1
retrieved, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqnBuilder(gotNs.GetName(), attr.GetName(), v1.GetValue())},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(retrieved)
Expand All @@ -1530,19 +1485,13 @@ func (s *AttributeFqnSuite) TestGetAttributesByValueFqns_Fails_WithNonValueFqns(
attrFqn := fqnBuilder("example.com", "attr1", "")
v, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{nsFqn},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(v)
s.Require().ErrorIs(err, db.ErrNotFound)

v, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{attrFqn},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Nil(v)
Expand Down
6 changes: 0 additions & 6 deletions service/integration/attribute_values_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,6 @@ func (s *AttributeValuesSuite) Test_UnsafeUpdateAttributeValue() {
original := "https://example.net/attr/attr1/value/created_value"
retrieved, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{original},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().Error(err)
s.Require().ErrorIs(err, db.ErrNotFound)
Expand All @@ -483,9 +480,6 @@ func (s *AttributeValuesSuite) Test_UnsafeUpdateAttributeValue() {
updated := "https://example.net/attr/attr1/value/new_value"
retrieved, err = s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{updated},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)
s.NotNil(retrieved)
Expand Down
12 changes: 0 additions & 12 deletions service/integration/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,6 @@ func (s *AttributesSuite) Test_GetAttribute_OrderOfValuesIsPreserved() {
fqns := []string{fmt.Sprintf("https://%s/attr/%s/value/%s", gotAttr.GetNamespace().GetName(), createdAttr.GetName(), gotAttr.GetValues()[0].GetValue())}
req := &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
}
resp, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, req)
s.Require().NoError(err)
Expand Down Expand Up @@ -695,9 +692,6 @@ func (s *AttributesSuite) Test_UnsafeUpdateAttribute_WithRuleAndNameAndReorderin

val, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, &attributes.GetAttributeValuesByFqnsRequest{
Fqns: []string{fqn},
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
})
s.Require().NoError(err)
s.NotNil(val)
Expand Down Expand Up @@ -787,9 +781,6 @@ func (s *AttributesSuite) Test_UnsafeUpdateAttribute_WithNewName() {
}
req := &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
}
retrieved, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, req)
s.Require().NoError(err)
Expand Down Expand Up @@ -934,9 +925,6 @@ func (s *AttributesSuite) Test_UnsafeDeleteAttribute() {
fqns := []string{fmt.Sprintf("https://%s/attr/%s/value/%s", ns.GetName(), name, v.GetValue())}
req := &attributes.GetAttributeValuesByFqnsRequest{
Fqns: fqns,
WithValue: &policy.AttributeValueSelector{
WithSubjectMaps: true,
},
}
retrieved, err := s.db.PolicyClient.GetAttributesByValueFqns(s.ctx, req)
s.Require().Error(err)
Expand Down
3 changes: 1 addition & 2 deletions service/rttests/rt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ func (s *RoundtripSuite) CreateTestData() error {
// get the attribute ids for the values were mapping to the client
var attributeValueIDs []string
fqnResp, err := client.Attributes.GetAttributeValuesByFqns(context.Background(), &attributes.GetAttributeValuesByFqnsRequest{
Fqns: attributesToMap,
WithValue: &policy.AttributeValueSelector{},
Fqns: attributesToMap,
})
if err != nil {
slog.Error("get attribute values by fqn ", slog.String("error", err.Error()))
Expand Down
Loading