Skip to content

Commit 69eff4a

Browse files
authored
access control validation and merge logic updates (#3343)
2 parents c1549fd + ac1ed29 commit 69eff4a

File tree

13 files changed

+1246
-274
lines changed

13 files changed

+1246
-274
lines changed

.changeset/orange-yaks-double.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/composition": patch
3+
---
4+
5+
Fixed access control verification of transitive requirements (through `@requires` and/or `@fromContext`) to ensure it works with chains of transitive dependencies.

.changeset/shaggy-adults-help.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@apollo/composition": patch
3+
"@apollo/federation-internals": patch
4+
---
5+
Allow interface object fields to specify access control
6+
7+
Update composition logic to allow specifying access control directives (`@authenticated`, `@requiresScopes` and `@policy`) on `@interfaceObject` fields. While we disallow access control on interface types and fields, we decided to support it on `@interfaceObject` as it is a useful pattern to define a single resolver (that may need access controls) for common interface fields. Alternative would require our users to explicitly define resolvers for all implementations which defeats the purpose of `@interfaceObject`.
8+
9+
This PR refactors in how we propagate access control by providing additional merge sources when merging directives on interfaces, interface fields and object fields.

.changeset/smart-crabs-jump.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/federation-internals": patch
3+
---
4+
5+
Fixed demand control validations to unwrap non-nullable composite types and fields when performing validations.

0 commit comments

Comments
 (0)