Skip to content

Commit

Permalink
Make AsyncSecurityPolicy.checkAuthorizationAsync public.
Browse files Browse the repository at this point in the history
I initially omitted the visibility modifier because this class began as an interface. Since it moved to an abstract class, we must make it public so it can be overriden by subclasses in the integrator's packages.

Part of grpc#10566.
  • Loading branch information
mateusazis committed Jan 18, 2024
1 parent 5b082ca commit c4d43ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void testFailedFuturesPropagateOriginalException() throws Exception {
ServerSecurityPolicy.newBuilder()
.servicePolicy("foo", new AsyncSecurityPolicy() {
@Override
ListenableFuture<Status> checkAuthorizationAsync(int uid) {
public ListenableFuture<Status> checkAuthorizationAsync(int uid) {
return Futures.immediateFailedFuture(originalException);
}
})
Expand All @@ -207,7 +207,7 @@ public void testFailedFuturesAreNotCachedPermanently() throws Exception {
ServerSecurityPolicy.newBuilder()
.servicePolicy("foo", new AsyncSecurityPolicy() {
@Override
ListenableFuture<Status> checkAuthorizationAsync(int uid) {
public ListenableFuture<Status> checkAuthorizationAsync(int uid) {
if (firstAttempt.getAndSet(false)) {
return Futures.immediateFailedFuture(new IllegalStateException());
}
Expand All @@ -229,7 +229,7 @@ public void testCancelledFuturesAreNotCachedPermanently() throws Exception {
ServerSecurityPolicy.newBuilder()
.servicePolicy("foo", new AsyncSecurityPolicy() {
@Override
ListenableFuture<Status> checkAuthorizationAsync(int uid) {
public ListenableFuture<Status> checkAuthorizationAsync(int uid) {
if (firstAttempt.getAndSet(false)) {
return Futures.immediateCancelledFuture();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ public final Status checkAuthorization(int uid) {
* @return A {@link ListenableFuture} for a gRPC {@link Status} object, with OK indicating
* authorized.
*/
abstract ListenableFuture<Status> checkAuthorizationAsync(int uid);
public abstract ListenableFuture<Status> checkAuthorizationAsync(int uid);
}

0 comments on commit c4d43ae

Please sign in to comment.