errors can be looked up also migrations changed
This commit is contained in:
@@ -34,6 +34,10 @@ service AuthService {
|
||||
rpc ListRolePermissions(ListRolePermissionsRequest) returns (RolePermissions);
|
||||
rpc ListGrantableObjects(ListGrantableObjectsRequest) returns (ListGrantableObjectsResponse);
|
||||
|
||||
// Support diagnostics. Requires read on diagnostics:internal-errors.
|
||||
rpc ListInternalErrors(ListInternalErrorsRequest) returns (ListInternalErrorsResponse);
|
||||
rpc GetInternalError(GetInternalErrorRequest) returns (InternalError);
|
||||
|
||||
// User administration.
|
||||
rpc AssignUserRole(AssignUserRoleRequest) returns (UserSummary);
|
||||
// Resets a lower-ranked user's password.
|
||||
@@ -184,7 +188,7 @@ message GrantableObject {
|
||||
string profile = 2;
|
||||
// Set only for a table-family root.
|
||||
string table = 3;
|
||||
// One of global_data, global_journal, profile, journal, or table.
|
||||
// One of global_data, global_journal, profile, journal, table, or diagnostics.
|
||||
string kind = 4;
|
||||
// Actions the caller may grant to target_role for this object.
|
||||
repeated string allowed_actions = 5;
|
||||
@@ -194,6 +198,50 @@ message ListGrantableObjectsResponse {
|
||||
repeated GrantableObject objects = 1;
|
||||
}
|
||||
|
||||
message InternalError {
|
||||
string reference_id = 1;
|
||||
string user_id = 2;
|
||||
string username = 3;
|
||||
string grpc_method = 4;
|
||||
string detail = 5;
|
||||
int64 occurred_at_unix_milliseconds = 6;
|
||||
}
|
||||
|
||||
message ListInternalErrorsRequest {
|
||||
// Every non-empty text/UUID field is an optional filter. Username and method
|
||||
// use case-insensitive substring matching.
|
||||
string reference_id = 1;
|
||||
string user_id = 2;
|
||||
string username = 3;
|
||||
string grpc_method = 4;
|
||||
int64 occurred_from_unix_seconds = 5;
|
||||
int64 occurred_to_unix_seconds = 6;
|
||||
InternalErrorSort sort = 7;
|
||||
// Unspecified sort always means newest first. For an explicit sort, false is
|
||||
// ascending and true is descending.
|
||||
bool descending = 8;
|
||||
// Defaults to 100 and is capped at 500.
|
||||
uint32 limit = 9;
|
||||
uint64 offset = 10;
|
||||
}
|
||||
|
||||
enum InternalErrorSort {
|
||||
INTERNAL_ERROR_SORT_UNSPECIFIED = 0;
|
||||
INTERNAL_ERROR_SORT_OCCURRED_AT = 1;
|
||||
INTERNAL_ERROR_SORT_REFERENCE_ID = 2;
|
||||
INTERNAL_ERROR_SORT_USERNAME = 3;
|
||||
INTERNAL_ERROR_SORT_GRPC_METHOD = 4;
|
||||
}
|
||||
|
||||
message ListInternalErrorsResponse {
|
||||
repeated InternalError errors = 1;
|
||||
uint64 total_count = 2;
|
||||
}
|
||||
|
||||
message GetInternalErrorRequest {
|
||||
string reference_id = 1;
|
||||
}
|
||||
|
||||
message AssignUserRoleRequest {
|
||||
string username = 1;
|
||||
string role = 2;
|
||||
|
||||
Binary file not shown.
@@ -235,7 +235,7 @@ pub struct GrantableObject {
|
||||
/// Set only for a table-family root.
|
||||
#[prost(string, tag = "3")]
|
||||
pub table: ::prost::alloc::string::String,
|
||||
/// One of global_data, global_journal, profile, journal, or table.
|
||||
/// One of global_data, global_journal, profile, journal, table, or diagnostics.
|
||||
#[prost(string, tag = "4")]
|
||||
pub kind: ::prost::alloc::string::String,
|
||||
/// Actions the caller may grant to target_role for this object.
|
||||
@@ -250,6 +250,65 @@ pub struct ListGrantableObjectsResponse {
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct InternalError {
|
||||
#[prost(string, tag = "1")]
|
||||
pub reference_id: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "2")]
|
||||
pub user_id: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "3")]
|
||||
pub username: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "4")]
|
||||
pub grpc_method: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "5")]
|
||||
pub detail: ::prost::alloc::string::String,
|
||||
#[prost(int64, tag = "6")]
|
||||
pub occurred_at_unix_milliseconds: i64,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct ListInternalErrorsRequest {
|
||||
/// Every non-empty text/UUID field is an optional filter. Username and method
|
||||
/// use case-insensitive substring matching.
|
||||
#[prost(string, tag = "1")]
|
||||
pub reference_id: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "2")]
|
||||
pub user_id: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "3")]
|
||||
pub username: ::prost::alloc::string::String,
|
||||
#[prost(string, tag = "4")]
|
||||
pub grpc_method: ::prost::alloc::string::String,
|
||||
#[prost(int64, tag = "5")]
|
||||
pub occurred_from_unix_seconds: i64,
|
||||
#[prost(int64, tag = "6")]
|
||||
pub occurred_to_unix_seconds: i64,
|
||||
#[prost(enumeration = "InternalErrorSort", tag = "7")]
|
||||
pub sort: i32,
|
||||
/// Unspecified sort always means newest first. For an explicit sort, false is
|
||||
/// ascending and true is descending.
|
||||
#[prost(bool, tag = "8")]
|
||||
pub descending: bool,
|
||||
/// Defaults to 100 and is capped at 500.
|
||||
#[prost(uint32, tag = "9")]
|
||||
pub limit: u32,
|
||||
#[prost(uint64, tag = "10")]
|
||||
pub offset: u64,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct ListInternalErrorsResponse {
|
||||
#[prost(message, repeated, tag = "1")]
|
||||
pub errors: ::prost::alloc::vec::Vec<InternalError>,
|
||||
#[prost(uint64, tag = "2")]
|
||||
pub total_count: u64,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct GetInternalErrorRequest {
|
||||
#[prost(string, tag = "1")]
|
||||
pub reference_id: ::prost::alloc::string::String,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct AssignUserRoleRequest {
|
||||
#[prost(string, tag = "1")]
|
||||
pub username: ::prost::alloc::string::String,
|
||||
@@ -287,6 +346,42 @@ pub struct ListUsersResponse {
|
||||
#[prost(message, repeated, tag = "1")]
|
||||
pub users: ::prost::alloc::vec::Vec<UserSummary>,
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
|
||||
#[repr(i32)]
|
||||
pub enum InternalErrorSort {
|
||||
Unspecified = 0,
|
||||
OccurredAt = 1,
|
||||
ReferenceId = 2,
|
||||
Username = 3,
|
||||
GrpcMethod = 4,
|
||||
}
|
||||
impl InternalErrorSort {
|
||||
/// String value of the enum field names used in the ProtoBuf definition.
|
||||
///
|
||||
/// The values are not transformed in any way and thus are considered stable
|
||||
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
|
||||
pub fn as_str_name(&self) -> &'static str {
|
||||
match self {
|
||||
Self::Unspecified => "INTERNAL_ERROR_SORT_UNSPECIFIED",
|
||||
Self::OccurredAt => "INTERNAL_ERROR_SORT_OCCURRED_AT",
|
||||
Self::ReferenceId => "INTERNAL_ERROR_SORT_REFERENCE_ID",
|
||||
Self::Username => "INTERNAL_ERROR_SORT_USERNAME",
|
||||
Self::GrpcMethod => "INTERNAL_ERROR_SORT_GRPC_METHOD",
|
||||
}
|
||||
}
|
||||
/// Creates an enum from field names used in the ProtoBuf definition.
|
||||
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
|
||||
match value {
|
||||
"INTERNAL_ERROR_SORT_UNSPECIFIED" => Some(Self::Unspecified),
|
||||
"INTERNAL_ERROR_SORT_OCCURRED_AT" => Some(Self::OccurredAt),
|
||||
"INTERNAL_ERROR_SORT_REFERENCE_ID" => Some(Self::ReferenceId),
|
||||
"INTERNAL_ERROR_SORT_USERNAME" => Some(Self::Username),
|
||||
"INTERNAL_ERROR_SORT_GRPC_METHOD" => Some(Self::GrpcMethod),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Generated client implementations.
|
||||
pub mod auth_service_client {
|
||||
#![allow(
|
||||
@@ -716,6 +811,54 @@ pub mod auth_service_client {
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Support diagnostics. Requires read on diagnostics:internal-errors.
|
||||
pub async fn list_internal_errors(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::ListInternalErrorsRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::ListInternalErrorsResponse>,
|
||||
tonic::Status,
|
||||
> {
|
||||
self.inner
|
||||
.ready()
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tonic::Status::unknown(
|
||||
format!("Service was not ready: {}", e.into()),
|
||||
)
|
||||
})?;
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/komp_ac.auth.AuthService/ListInternalErrors",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(
|
||||
GrpcMethod::new("komp_ac.auth.AuthService", "ListInternalErrors"),
|
||||
);
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
pub async fn get_internal_error(
|
||||
&mut self,
|
||||
request: impl tonic::IntoRequest<super::GetInternalErrorRequest>,
|
||||
) -> std::result::Result<tonic::Response<super::InternalError>, tonic::Status> {
|
||||
self.inner
|
||||
.ready()
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tonic::Status::unknown(
|
||||
format!("Service was not ready: {}", e.into()),
|
||||
)
|
||||
})?;
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/komp_ac.auth.AuthService/GetInternalError",
|
||||
);
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("komp_ac.auth.AuthService", "GetInternalError"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// User administration.
|
||||
pub async fn assign_user_role(
|
||||
&mut self,
|
||||
@@ -886,6 +1029,18 @@ pub mod auth_service_server {
|
||||
tonic::Response<super::ListGrantableObjectsResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
/// Support diagnostics. Requires read on diagnostics:internal-errors.
|
||||
async fn list_internal_errors(
|
||||
&self,
|
||||
request: tonic::Request<super::ListInternalErrorsRequest>,
|
||||
) -> std::result::Result<
|
||||
tonic::Response<super::ListInternalErrorsResponse>,
|
||||
tonic::Status,
|
||||
>;
|
||||
async fn get_internal_error(
|
||||
&self,
|
||||
request: tonic::Request<super::GetInternalErrorRequest>,
|
||||
) -> std::result::Result<tonic::Response<super::InternalError>, tonic::Status>;
|
||||
/// User administration.
|
||||
async fn assign_user_role(
|
||||
&self,
|
||||
@@ -1614,6 +1769,98 @@ pub mod auth_service_server {
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.auth.AuthService/ListInternalErrors" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct ListInternalErrorsSvc<T: AuthService>(pub Arc<T>);
|
||||
impl<
|
||||
T: AuthService,
|
||||
> tonic::server::UnaryService<super::ListInternalErrorsRequest>
|
||||
for ListInternalErrorsSvc<T> {
|
||||
type Response = super::ListInternalErrorsResponse;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::ListInternalErrorsRequest>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as AuthService>::list_internal_errors(&inner, request)
|
||||
.await
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
}
|
||||
let accept_compression_encodings = self.accept_compression_encodings;
|
||||
let send_compression_encodings = self.send_compression_encodings;
|
||||
let max_decoding_message_size = self.max_decoding_message_size;
|
||||
let max_encoding_message_size = self.max_encoding_message_size;
|
||||
let inner = self.inner.clone();
|
||||
let fut = async move {
|
||||
let method = ListInternalErrorsSvc(inner);
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let mut grpc = tonic::server::Grpc::new(codec)
|
||||
.apply_compression_config(
|
||||
accept_compression_encodings,
|
||||
send_compression_encodings,
|
||||
)
|
||||
.apply_max_message_size_config(
|
||||
max_decoding_message_size,
|
||||
max_encoding_message_size,
|
||||
);
|
||||
let res = grpc.unary(method, req).await;
|
||||
Ok(res)
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.auth.AuthService/GetInternalError" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct GetInternalErrorSvc<T: AuthService>(pub Arc<T>);
|
||||
impl<
|
||||
T: AuthService,
|
||||
> tonic::server::UnaryService<super::GetInternalErrorRequest>
|
||||
for GetInternalErrorSvc<T> {
|
||||
type Response = super::InternalError;
|
||||
type Future = BoxFuture<
|
||||
tonic::Response<Self::Response>,
|
||||
tonic::Status,
|
||||
>;
|
||||
fn call(
|
||||
&mut self,
|
||||
request: tonic::Request<super::GetInternalErrorRequest>,
|
||||
) -> Self::Future {
|
||||
let inner = Arc::clone(&self.0);
|
||||
let fut = async move {
|
||||
<T as AuthService>::get_internal_error(&inner, request)
|
||||
.await
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
}
|
||||
let accept_compression_encodings = self.accept_compression_encodings;
|
||||
let send_compression_encodings = self.send_compression_encodings;
|
||||
let max_decoding_message_size = self.max_decoding_message_size;
|
||||
let max_encoding_message_size = self.max_encoding_message_size;
|
||||
let inner = self.inner.clone();
|
||||
let fut = async move {
|
||||
let method = GetInternalErrorSvc(inner);
|
||||
let codec = tonic_prost::ProstCodec::default();
|
||||
let mut grpc = tonic::server::Grpc::new(codec)
|
||||
.apply_compression_config(
|
||||
accept_compression_encodings,
|
||||
send_compression_encodings,
|
||||
)
|
||||
.apply_max_message_size_config(
|
||||
max_decoding_message_size,
|
||||
max_encoding_message_size,
|
||||
);
|
||||
let res = grpc.unary(method, req).await;
|
||||
Ok(res)
|
||||
};
|
||||
Box::pin(fut)
|
||||
}
|
||||
"/komp_ac.auth.AuthService/AssignUserRole" => {
|
||||
#[allow(non_camel_case_types)]
|
||||
struct AssignUserRoleSvc<T: AuthService>(pub Arc<T>);
|
||||
|
||||
Reference in New Issue
Block a user