Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add authorized view bindings to Cloud Bigtable data APIs and messages #2144

Merged
merged 7 commits into from
Mar 5, 2024
  •  
  •  
  •  
Prev Previous commit
Next Next commit
🦉 Updates from OwlBot post-processor
  • Loading branch information
gcf-owl-bot[bot] committed Mar 4, 2024
commit acc4f02e068e2025038f27f52115f4fcbd35368f
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,37 @@ public class GrpcBigtableStub extends BigtableStub {
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate READ_ROWS_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate READ_ROWS_2_PATH_TEMPLATE =
PathTemplate.create(
"{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}");
private static final PathTemplate SAMPLE_ROW_KEYS_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate SAMPLE_ROW_KEYS_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate SAMPLE_ROW_KEYS_2_PATH_TEMPLATE =
PathTemplate.create(
"{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}");
private static final PathTemplate MUTATE_ROW_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate MUTATE_ROW_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate MUTATE_ROW_2_PATH_TEMPLATE =
PathTemplate.create(
"{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}");
private static final PathTemplate MUTATE_ROWS_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate MUTATE_ROWS_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate MUTATE_ROWS_2_PATH_TEMPLATE =
PathTemplate.create(
"{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}");
private static final PathTemplate CHECK_AND_MUTATE_ROW_0_PATH_TEMPLATE =
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate CHECK_AND_MUTATE_ROW_2_PATH_TEMPLATE =
PathTemplate.create(
"{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}");
private static final PathTemplate PING_AND_WARM_0_PATH_TEMPLATE =
PathTemplate.create("{name=projects/*/instances/*}");
private static final PathTemplate PING_AND_WARM_1_PATH_TEMPLATE =
Expand All @@ -205,6 +220,9 @@ public class GrpcBigtableStub extends BigtableStub {
PathTemplate.create("{table_name=projects/*/instances/*/tables/*}");
private static final PathTemplate READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE =
PathTemplate.create("{app_profile_id=**}");
private static final PathTemplate READ_MODIFY_WRITE_ROW_2_PATH_TEMPLATE =
PathTemplate.create(
"{authorized_view_name=projects/*/instances/*/tables/*/authorizedViews/*}");

public static final GrpcBigtableStub create(BigtableStubSettings settings) throws IOException {
return new GrpcBigtableStub(settings, ClientContext.create(settings));
Expand Down Expand Up @@ -250,6 +268,10 @@ protected GrpcBigtableStub(
builder.add(request.getTableName(), "table_name", READ_ROWS_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", READ_ROWS_1_PATH_TEMPLATE);
builder.add(
request.getAuthorizedViewName(),
"authorized_view_name",
READ_ROWS_2_PATH_TEMPLATE);
return builder.build();
})
.build();
Expand All @@ -263,6 +285,10 @@ protected GrpcBigtableStub(
request.getTableName(), "table_name", SAMPLE_ROW_KEYS_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", SAMPLE_ROW_KEYS_1_PATH_TEMPLATE);
builder.add(
request.getAuthorizedViewName(),
"authorized_view_name",
SAMPLE_ROW_KEYS_2_PATH_TEMPLATE);
return builder.build();
})
.build();
Expand All @@ -275,6 +301,10 @@ protected GrpcBigtableStub(
builder.add(request.getTableName(), "table_name", MUTATE_ROW_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", MUTATE_ROW_1_PATH_TEMPLATE);
builder.add(
request.getAuthorizedViewName(),
"authorized_view_name",
MUTATE_ROW_2_PATH_TEMPLATE);
return builder.build();
})
.build();
Expand All @@ -287,6 +317,10 @@ protected GrpcBigtableStub(
builder.add(request.getTableName(), "table_name", MUTATE_ROWS_0_PATH_TEMPLATE);
builder.add(
request.getAppProfileId(), "app_profile_id", MUTATE_ROWS_1_PATH_TEMPLATE);
builder.add(
request.getAuthorizedViewName(),
"authorized_view_name",
MUTATE_ROWS_2_PATH_TEMPLATE);
return builder.build();
})
.build();
Expand All @@ -305,6 +339,10 @@ protected GrpcBigtableStub(
request.getAppProfileId(),
"app_profile_id",
CHECK_AND_MUTATE_ROW_1_PATH_TEMPLATE);
builder.add(
request.getAuthorizedViewName(),
"authorized_view_name",
CHECK_AND_MUTATE_ROW_2_PATH_TEMPLATE);
return builder.build();
})
.build();
Expand Down Expand Up @@ -335,6 +373,10 @@ protected GrpcBigtableStub(
request.getAppProfileId(),
"app_profile_id",
READ_MODIFY_WRITE_ROW_1_PATH_TEMPLATE);
builder.add(
request.getAuthorizedViewName(),
"authorized_view_name",
READ_MODIFY_WRITE_ROW_2_PATH_TEMPLATE);
return builder.build();
})
.build();
Expand Down