Commit Graph
10 Commits
Author SHA1 Message Date
Guice TeamandGuice Team 67c957b5e4 Include the @RestrictedBindingSource explanation as a missing binding suggestion.
PiperOrigin-RevId: 334803319
2020-10-01 06:48:28 -07:00
vzmandNick 969dff1892 Fix @RestrictedBindingSource bug where scanner-installed modules don't inherit permits.
Without this fix @RBS doesn't work with @ProvidesForRequest, because it provides the binding via a module installed in the scanner.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=324205733
2020-07-31 13:12:22 -05:00
vzmandDavid P. Baker 1bfd944682 Enable logging warnings on RestrictedBindingSource violations (ie. the restrictionLevel knob).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320716882
2020-07-13 11:39:49 -04:00
diamondmandkevinb9n d65c576a21 Simplify some usages of Key.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320184863
2020-07-08 12:51:29 -07:00
vzmandkevinb9n d854f75339 Support permits on anonymous classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=319854009
2020-07-08 12:51:29 -07:00
vzmandkevinb9n 654f7098eb Enable permits to be given to ModuleAnnotatedMethodScanners.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=319814886
2020-07-06 15:07:52 -07:00
vzmandNick e9ed1f6477 Change @RestrictedBindingSource semantics such that qualified bindings are only restricted by their annotation's restriciton.
Since qualifier annotations are just cheap ways to create a wrapper type this seems like the most logical thing to do.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=317277968
2020-06-22 09:32:13 -04:00
vzmandChris Povirk 11667ab03d Add withTrustedSource API to RecordingBinder.
This API enables the re-writing of Module Bindings - via Element.applyTo(Binder) - to be trustworthy for @RestrictedBindingSource.

Use the API on all 6 Module Binding implementations:
- InstanceBindingImpl
- ConstructorBindingImpl
- ProviderInstanceBindingImpl
- LinkedBindingImpl
- LinkedProviderBindingImpl
- UntargettedBindingImpl

These are exhaustive based on auditing RecordingBinder's implementaiton of Binder APIs for adding bindings: bind(*) and bindConstant().

- bind(*) calls add bindings through com.google.inject.internal.BindingBuilder, which creates all 6 kinds of binding.
- bindConstant() creates a InstanceBindingImpl.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=315506112
2020-06-09 20:46:31 -04:00
vzmandColin Decker 77977332e0 Add mechanism to exempt modules from @RestrictedBindingSource (useful when retrofitting bindings with this restriction).
Based on @RestrictedApi's allowedOnPath exemption mechanism.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=312440865
2020-05-20 16:01:11 -04:00
vzmandKurt Alfred Kluever 0d7775f2f6 Implement @RestrictedBindingSource.
Change semantics when both type and qualifier annotation are restricted (annotation wins).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=311722847
2020-05-17 00:10:41 -04:00