Skip to content

Renaming to prepare for proc/function support for Pg #1179

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Auth/AuthorizationMetadataHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public class EntityMetadata
public Dictionary<Operation, List<string>> OperationToRolesMap { get; set; } = new();

/// <summary>
/// Set of Http verbs enabled for Stored Procedure entities that have their REST endpoint enabled.
/// Set of Http verbs enabled for Stored Procedure/Function entities that have their REST endpoint enabled.
/// </summary>
public HashSet<RestMethod> StoredProcedureHttpVerbs { get; set; } = new();
public HashSet<RestMethod> DatabaseExecutableHttpVerbs { get; set; } = new();

/// <summary>
/// Defines the type of database object the entity represents.
/// Examples include Table, View, StoredProcedure
/// Examples include Table, View, StoredProcedure, Function
/// </summary>
public SourceType ObjectType { get; set; } = SourceType.Table;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Auth/IAuthorizationResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ public interface IAuthorizationResolver

/// <summary>
/// Returns whether the httpVerb (GET, POST, PUT, PATCH, DELETE) is allowed to be performed
/// on the stored procedure (represented by entityName) for the role: roleName.
/// on the stored procedure or function (represented by entityName) for the role: roleName.
/// </summary>
/// <param name="entityName"></param>
/// <param name="roleName"></param>
/// <param name="httpVerb"></param>
/// <returns>True if the execution of the stored procedure is permitted. Otherwise, false.</returns>
public bool IsStoredProcedureExecutionPermitted(string entityName, string roleName, RestMethod httpVerb);
/// <returns>True if the execution of the stored procedure/function is permitted. Otherwise, false.</returns>
public bool IsDatabaseExecutableExecutionPermitted(string entityName, string roleName, RestMethod httpVerb);

/// <summary>
/// Returns a list of roles which define permissions for the provided operation.
Expand Down
32 changes: 16 additions & 16 deletions src/Cli/src/CommandLineOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public EntityOptions(
IEnumerable<string>? sourceParameters,
IEnumerable<string>? sourceKeyFields,
string? restRoute,
IEnumerable<string>? restMethodsForStoredProcedure,
IEnumerable<string>? restMethodsForDatabaseExecutable,
string? graphQLType,
string? graphQLOperationForStoredProcedure,
string? graphQLOperationForDatabaseExecutable,
IEnumerable<string>? fieldsToInclude,
IEnumerable<string>? fieldsToExclude,
string? policyRequest,
Expand All @@ -114,9 +114,9 @@ public EntityOptions(
SourceParameters = sourceParameters;
SourceKeyFields = sourceKeyFields;
RestRoute = restRoute;
RestMethodsForStoredProcedure = restMethodsForStoredProcedure;
RestMethodsForDatabaseExecutable = restMethodsForDatabaseExecutable;
GraphQLType = graphQLType;
GraphQLOperationForStoredProcedure = graphQLOperationForStoredProcedure;
GraphQLOperationForDatabaseExecutable = graphQLOperationForDatabaseExecutable;
FieldsToInclude = fieldsToInclude;
FieldsToExclude = fieldsToExclude;
PolicyRequest = policyRequest;
Expand All @@ -139,14 +139,14 @@ public EntityOptions(
[Option("rest", Required = false, HelpText = "Route for rest api.")]
public string? RestRoute { get; }

[Option("rest.methods", Required = false, Separator = ',', HelpText = "HTTP actions to be supported for stored procedure. Specify the actions as a comma separated list. Valid HTTP actions are : [GET, POST, PUT, PATCH, DELETE]")]
public IEnumerable<string>? RestMethodsForStoredProcedure { get; }
[Option("rest.methods", Required = false, Separator = ',', HelpText = "HTTP actions to be supported for stored procedure and function. Specify the actions as a comma separated list. Valid HTTP actions are : [GET, POST, PUT, PATCH, DELETE]")]
public IEnumerable<string>? RestMethodsForDatabaseExecutable { get; }

[Option("graphql", Required = false, HelpText = "Type of graphQL.")]
public string? GraphQLType { get; }

[Option("graphql.operation", Required = false, HelpText = $"GraphQL operation to be supported for stored procedure. Valid operations are : [Query, Mutation] ")]
public string? GraphQLOperationForStoredProcedure { get; }
[Option("graphql.operation", Required = false, HelpText = $"GraphQL operation to be supported for stored procedure and function. Valid operations are : [Query, Mutation] ")]
public string? GraphQLOperationForDatabaseExecutable { get; }

[Option("fields.include", Required = false, Separator = ',', HelpText = "Fields that are allowed access to permission.")]
public IEnumerable<string>? FieldsToInclude { get; }
Expand Down Expand Up @@ -175,9 +175,9 @@ public AddOptions(
IEnumerable<string>? sourceParameters,
IEnumerable<string>? sourceKeyFields,
string? restRoute,
IEnumerable<string>? restMethodsForStoredProcedure,
IEnumerable<string>? restMethodsForDatabaseExecutable,
string? graphQLType,
string? graphQLOperationForStoredProcedure,
string? graphQLOperationForDatabaseExecutable,
IEnumerable<string>? fieldsToInclude,
IEnumerable<string>? fieldsToExclude,
string? policyRequest,
Expand All @@ -188,9 +188,9 @@ public AddOptions(
sourceParameters,
sourceKeyFields,
restRoute,
restMethodsForStoredProcedure,
restMethodsForDatabaseExecutable,
graphQLType,
graphQLOperationForStoredProcedure,
graphQLOperationForDatabaseExecutable,
fieldsToInclude,
fieldsToExclude,
policyRequest,
Expand Down Expand Up @@ -230,9 +230,9 @@ public UpdateOptions(
IEnumerable<string>? sourceParameters,
IEnumerable<string>? sourceKeyFields,
string? restRoute,
IEnumerable<string>? restMethodsForStoredProcedure,
IEnumerable<string>? restMethodsForDatabaseExecutable,
string? graphQLType,
string? graphQLOperationForStoredProcedure,
string? graphQLOperationForDatabaseExecutable,
IEnumerable<string>? fieldsToInclude,
IEnumerable<string>? fieldsToExclude,
string? policyRequest,
Expand All @@ -243,9 +243,9 @@ public UpdateOptions(
sourceParameters,
sourceKeyFields,
restRoute,
restMethodsForStoredProcedure,
restMethodsForDatabaseExecutable,
graphQLType,
graphQLOperationForStoredProcedure,
graphQLOperationForDatabaseExecutable,
fieldsToInclude,
fieldsToExclude,
policyRequest,
Expand Down
Loading