Authorization verification method, device and system, business authority configuration method and device
By receiving user requests and obtaining identity and business identification information, calling the target verification method for permission verification, the problem of strong coupling of business permission verification and subsequent logic is solved, and the decoupling of permission verification and business logic is achieved, which simplifies the Code maintenance and improves verification flexibility and clarity.
Patent Information
- Application Number
- CN202010983552.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-17
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2040-09-17
AI Technical Summary
In the permission verification methods of existing procurement platforms, business permission verification is strongly coupled with real business logic, which leads to difficulty in maintaining functional codes and redundant, especially when the business logic link is long, there are a large amount of redundant permission verification content.
By receiving the user's business request, obtaining identity information and business identification information, obtaining target business permission configuration information, calling the target verification method to perform permission verification, and performing subsequent business logic processing after the verification is passed, realizing the business permissions The verification is separated from subsequent logic to simplify code maintenance.
Effectively decoupling of business permission verification and subsequent business logic processing simplifies code maintenance, improves the flexibility and clarity of business permission verification, and reduces redundant permission verification content.
Smart Images

Figure CN112115511B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a permission verification method, device and system, and a business permission configuration method and device. Background Art
[0002] With the improvement and development of the procurement system, the specialization, informatization and centralization of procurement have been orderly promoted, which has greatly promoted the development of the procurement platform. At present, the process of the procurement platform is mainly: after initiating a data request, the business subsystem will perform platform authority verification, and after passing the verification, it will enter the business code module to perform the underlying business authority verification and data assembly of the real business logic, and finally return the data.
[0003] The permission verification of some procurement platforms can basically be divided into two parts: (1) Platform permission verification: classify the identity types that access the business subsystem, and classify the visitors into operators, procurement supervisors, district administrators, procurement units, etc. according to their login accounts. Then, based on the different permission codes carried by different identities, it can be determined whether the account has the permission to access the uniform resource locator (URL); (2) Business permission verification: Business permission verification is coupled in the business code. Only when performing business logic queries can it be determined whether the person has the permission to view. For example, when a person wants to access someone else's document information, the business subsystem can only determine whether the person has the corresponding viewing permission after querying the corresponding document information.
[0004] Currently, this permission verification method mainly has the following problems in terms of business permission verification: business permission verification is strongly coupled with the actual business logic, which makes the overall functional code difficult to maintain; if the business logic link is relatively long, there will be corresponding business permission verification content at the intersection of each process, which will be relatively redundant. Summary of the invention
[0005] In view of this, the embodiments of this specification provide a permission verification method. This specification also relates to a permission verification device, a permission verification system, a business permission configuration method, a business permission configuration device, a computing device, and a computer-readable storage medium to solve the technical defects existing in the prior art.
[0006] According to a first aspect of an embodiment of this specification, a permission verification method is provided, which is applied to a business subsystem and includes:
[0007] Receiving a service request to be verified from a user, the service request carrying identity information and service identification information of the user;
[0008] According to the identity information and the service identification information, obtaining target service authority configuration information corresponding to the identity information and the service identification information;
[0009] Obtain a target verification method corresponding to the class name and method name in the target business authority configuration information;
[0010] Using the target service parameter in the service request as an input parameter of the target verification method, and calling the target verification method;
[0011] According to the calling result of the target verification method, determine whether the permission verification passes. If passed, execute subsequent business logic processing.
[0012] Optionally, the target service authority configuration information also includes a target parameter acquisition method. Before calling the target verification method, the authority verification method also includes:
[0013] The target service parameter is obtained from the service request using the target parameter obtaining method.
[0014] Optionally, the authority verification method further includes: when the business subsystem is started, according to the identification information of the business subsystem, obtaining the latest business authority configuration information corresponding to the identification information from the business configuration subsystem, and caching it in the business subsystem.
[0015] Optionally, the permission verification method further includes: obtaining the latest business permission configuration information corresponding to the identification information from the business configuration subsystem at a preset time interval according to the identification information of the business subsystem, and caching it in the business subsystem.
[0016] Optionally, the target verification method for obtaining the class name and method name corresponding to the target business authority configuration information includes:
[0017] Extract the class name and method name in the target business authority configuration information;
[0018] Obtaining a verification method corresponding to the class name in the object manager;
[0019] Obtain a target verification method corresponding to the method name in the verification method.
[0020] Optionally, the permission verification method further includes:
[0021] If the permission check fails, an error message is returned.
[0022] Optionally, the permission verification method further includes:
[0023] If the target service authority configuration information corresponding to the identity information and the service identification information is not obtained, obtaining the preset default service authority configuration information;
[0024] Using the target service parameter in the service request as the input parameter of the default verification method corresponding to the default service authority configuration information, and calling the default verification method;
[0025] According to the calling result of the default verification method, determine whether the permission verification passes, and if passed, execute subsequent business logic processing.
[0026] Optionally, the permission verification method further includes:
[0027] If the preset default business permission configuration information is not obtained, subsequent business logic processing is executed.
[0028] According to a second aspect of an embodiment of this specification, a service authority configuration method is provided, which is applied to a service configuration subsystem, and includes:
[0029] Determine the business type that needs to be subject to authority verification for each business subsystem in at least one business subsystem;
[0030] A plurality of business authority configuration information is created for identity types and business types of different users of each business subsystem in the at least one business subsystem.
[0031] Optionally, creating a plurality of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem includes:
[0032] Determine a resource path related to a business type for which each business subsystem in the at least one business subsystem needs to perform permission verification, wherein different resource paths represent different business types;
[0033] Create different class and method names for different combinations of identity types and resource paths;
[0034] Each identity type, resource path, class name, and method name is used as business permission configuration information.
[0035] Optionally, creating a plurality of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem includes:
[0036] Determine a resource path related to a business type for which each business subsystem in the at least one business subsystem needs to perform permission verification, wherein different resource paths represent different business types;
[0037] Define different parameter acquisition methods for different resource paths;
[0038] Create different class and method names for different combinations of identity types and resource paths;
[0039] Each identity type, resource path, parameter acquisition method, class name, and method name are used as business permission configuration information.
[0040] Optionally, the business authority configuration method further includes:
[0041] Default business authority configuration information is created for a preset combination of identity type and resource path, wherein the default business authority configuration information includes a method name of a default verification method.
[0042] Optionally, the service authority configuration method further includes: dynamically modifying at least one of the multiple service authority configuration information corresponding to the first service subsystem in the at least one service subsystem.
[0043] Optionally, the service authority configuration method further includes: storing the service authority configuration information in a configuration table.
[0044] According to a third aspect of an embodiment of this specification, a permission verification system is provided, including:
[0045] The business configuration subsystem is configured to: determine the business type that needs to be verified for authority in each business subsystem of at least one business subsystem; create multiple business authority configuration information for the identity type and business type of different users of each business subsystem of the at least one business subsystem;
[0046] At least one business subsystem is configured to: receive a business request to be verified from a user, the business request carrying the identity information and business identification information of the user; obtain, based on the identity information and the business identification information, target business authority configuration information corresponding to the identity information and the business identification information in the business authority configuration information created by the business configuration subsystem; obtain a target verification method corresponding to the class name and method name in the target business authority configuration information; use the target business parameters in the business request as input parameters of the target verification method and call the target verification method; determine whether the authority verification passes based on the calling result of the target verification method, and if so, execute subsequent business logic processing.
[0047] According to a fourth aspect of the embodiments of this specification, there is provided a permission verification device, which is applied to a business subsystem and includes:
[0048] A receiving module, configured to receive a service request to be verified from a user, wherein the service request carries the identity information and service identification information of the user;
[0049] A first acquisition module is configured to acquire target service authority configuration information corresponding to the identity information and the service identification information according to the identity information and the service identification information;
[0050] A second acquisition module is configured to acquire a target verification method corresponding to a class name and a method name in the target business authority configuration information;
[0051] A calling module is configured to use the target service parameter in the service request as an input parameter of the target verification method and call the target verification method;
[0052] The determination module is configured to determine whether the permission check passes according to the call result of the target verification method, and if passed, execute subsequent business logic processing.
[0053] According to a fifth aspect of the embodiments of this specification, a service authority configuration device is provided, which is applied to a service configuration subsystem, including:
[0054] A determination module is configured to determine a business type that requires permission verification for each business subsystem in at least one business subsystem;
[0055] The first creation module is configured to create a plurality of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem.
[0056] According to a sixth aspect of an embodiment of this specification, a computing device is provided, including:
[0057] Memory and processor;
[0058] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the following method:
[0059] Receiving a service request to be verified from a user, the service request carrying identity information and service identification information of the user;
[0060] According to the identity information and the service identification information, obtaining target service authority configuration information corresponding to the identity information and the service identification information;
[0061] Obtain a target verification method corresponding to the class name and method name in the target business authority configuration information;
[0062] Using the target service parameter in the service request as an input parameter of the target verification method, and calling the target verification method;
[0063] According to the calling result of the target verification method, determine whether the permission verification passes. If passed, execute subsequent business logic processing.
[0064] According to a seventh aspect of an embodiment of this specification, there is provided a computing device, including:
[0065] Memory and processor;
[0066] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the following method:
[0067] Determine the business type that needs to be subject to authority verification for each business subsystem in at least one business subsystem;
[0068] A plurality of business authority configuration information is created for identity types and business types of different users of each business subsystem in the at least one business subsystem.
[0069] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the permission verification method are implemented.
[0070] According to a ninth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer instructions, and when the instructions are executed by a processor, the steps of the business authority configuration method are implemented.
[0071] The permission verification method provided in this specification obtains the corresponding target business permission configuration information based on the identity information and business identification information carried in the user's business request, and then obtains the target verification method corresponding to the class name and method name in the target business permission configuration information, and uses the target business parameters in the business request as input parameters of the target verification method, calls the target verification method, and determines whether the permission verification passes based on the call result of the target verification method. If passed, executes subsequent business logic processing. The permission verification method according to this specification realizes the separation of the logic of business permission verification from subsequent business logic processing. Before executing subsequent business logic processing, business permission verification is performed in advance, making the code of subsequent business logic processing simple and easy to maintain.
[0072] The business permission configuration method provided in this specification determines the business type that needs to be verified for permission in each business subsystem in at least one business subsystem; creates multiple business permission configuration information for the identity type and business type of different users of each business subsystem in the at least one business subsystem. According to the business permission configuration method of this specification, permission configuration services are provided, and respective business permission verification logic can be configured for each business subsystem, making the verification logic of business permissions more flexible and clearer. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 A flowchart of a method for configuring service rights provided in an embodiment of this specification is shown;
[0074] Figure 2 A flowchart of a permission verification method provided by an embodiment of this specification is shown;
[0075] Figure 3 The overall process diagram of the business subsystem provided by an embodiment of this specification is shown;
[0076] Figure 4 A processing flow chart of a method for verifying the authority of querying document information on a procurement platform provided in an embodiment of this specification is shown;
[0077] Figure 5 A schematic diagram of the structure of a permission verification system provided by an embodiment of this specification is shown;
[0078] Figure 6 A schematic diagram showing the structure of a service authority configuration device provided in an embodiment of this specification is shown;
[0079] Figure 7 A schematic diagram of the structure of a permission verification device provided in an embodiment of this specification is shown;
[0080] Figure 8 A structural block diagram of a computing device provided in an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0081] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0082] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0083] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0084] First, the terms involved in one or more embodiments of this specification are explained.
[0085] Identity: The identity information of the account used to log into the platform. For example, in the procurement platform, it includes the operator identity, supplier identity, procurement unit identity, financial supervision identity, etc.
[0086] Platform permission verification: mainly identity verification, such as defining a certain URL that can be accessed as long as you log in, and a certain URL that can only be accessed by the purchasing unit role.
[0087] Business permission verification: A more fine-grained permission verification is mainly used to prevent the login user from seeing data that he should not see. For example, a purchasing unit can only see the documents created by itself and the documents reviewed by itself; a financial supervisor can see the documents created by all purchasing units under its own region.
[0088] In this specification, a permission verification method is provided. This specification also involves a permission verification device, a permission verification system, a business permission configuration method, a business permission configuration device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0089] Figure 1 A flowchart of a service authority configuration method provided according to an embodiment of the present specification is shown, which is applied to a service configuration subsystem and specifically includes steps 102 to 104 .
[0090] Step 102: Determine the business type that needs to be verified for authority in each business subsystem in at least one business subsystem.
[0091] The business configuration subsystem is responsible for business configuration for at least one business subsystem. A unique identity is assigned to each business subsystem in the at least one business subsystem. When the developer uses the business configuration subsystem to configure using a visual interface, the developer determines the business type that needs to be verified for permissions for each business subsystem. For example, for a procurement platform, the business type can be querying document information, creating a purchase order, etc. In one embodiment, different business types can be characterized as resource paths related to different types of businesses that require access permissions verification, wherein different resource paths represent different business types. The resource path may include a uniform resource locator (URL) path, which provides detailed information on how to access a specific resource. The URL path may be defined using an absolute path or a relative path. When defining a resource path, the request method may be defined at the same time, such as a GET request, a POST request, or other methods.
[0092] Step 104: Create multiple pieces of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem.
[0093] The identity type is the identity of the user who logs in to the business subsystem. For example, for the procurement platform, the identity type can be operator, procurement supervision, zoning administrator, procurement unit, etc. The business type is the business requested by the user. For example, for the procurement platform, it can be querying document information, creating purchase orders, etc. Create different business permission configuration information for the combination of identity type procurement unit and business type query document information and identity type procurement supervision and business type query document information.
[0094] The business authority configuration method according to this embodiment can create corresponding business authority configuration information, that is, corresponding business authority verification logic, for different business subsystems, so that the verification rules of the business authority of each business subsystem are clearer.
[0095] In one embodiment, creating multiple business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem may be implemented as follows:
[0096] Determine a resource path related to a business type for which each business subsystem in the at least one business subsystem needs to perform permission verification, wherein different resource paths represent different business types;
[0097] Create different class and method names for different combinations of identity types and resource paths;
[0098] Each identity type, resource path, class name, and method name is used as business permission configuration information.
[0099] Different class names and method names are created according to the combination of different identity types and resource paths to achieve different access rights for different identity types. For example, in the case where the resource path is the URL path for querying document information, if the identity type is procurement supervision, a verification method based on the division is configured and the first method name is assigned. If the identity type is a purchasing unit, a verification method based on the creator or purchasing unit is configured and the second method name is assigned. Procurement supervision sees a wide range of data, and many data are not from its own organization. It can see all data in its own block. Therefore, when configuring the verification method, a method of isolation by block is configured. Procurement supervision can see the data in its own block, while the purchasing unit can only see the data of its own unit. Another method is used for permission isolation verification, that is, a method of isolation by unit is configured. The URL path, class name, and first method name of procurement supervision and querying document information are stored as the first business permission configuration information, and the URL path, class name, and second method name of the purchasing unit and querying document information are stored as the second business permission configuration information. The above is an example of creating the same class name and different method names for different identities requesting the same URL path. Those skilled in the art can understand that different class names can be used for two identities requesting the same URL path, and they are not necessarily distinguished only by method names. That is, two methods configured by region and by unit can be written in the same verification class, but the methods are different. Of course, different verification classes, that is, different class names, can also be assigned. In addition, the business permission configuration information can be stored in the configuration table for centralized management, which is convenient for the business subsystem to pull and update.
[0100] In one embodiment, creating multiple business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem may be implemented as follows:
[0101] Determine a resource path related to a business type for which each business subsystem in the at least one business subsystem needs to perform permission verification, wherein different resource paths represent different business types;
[0102] Define different parameter acquisition methods for different resource paths;
[0103] Create different class and method names for different combinations of identity types and resource paths;
[0104] Each identity type, resource path, parameter acquisition method, class name, and method name are used as business permission configuration information.
[0105] In this embodiment, different parameter acquisition methods are defined for different resource paths. For example, for the URL for querying document information, the parameter acquisition method is defined as the first parameter acquisition method: obtain the ID of the document. If the identity type is procurement supervision, a verification method based on zoning is configured, and a first method name is assigned. If the identity type is a purchasing unit, a verification method based on the creator or the purchasing unit is configured, and a second method name is assigned. The URL path for procurement supervision and querying document information, the parameter acquisition method, the class name, and the first method name are stored as the first business authority configuration information, and the purchasing unit, the URL path for querying document information, the parameter acquisition method, the class name, and the second method name are stored as the second business authority configuration information.
[0106] In one embodiment, the service authority configuration method further includes:
[0107] Default business authority configuration information is created for a preset combination of identity type and resource path, wherein the default business authority configuration information includes a method name of a default verification method.
[0108] A default verification method can be configured for some or all combinations of identity types and resource paths, and its method name, identity type, resource path, parameter acquisition method, and class name can be stored as the default business permission configuration information. This is convenient for the business subsystem to obtain the default business permission configuration information when the corresponding target business permission configuration information is not obtained, and call the default verification method corresponding to the method name to determine whether the permission check passes.
[0109] In one embodiment, at least one of the multiple business authority configuration information corresponding to the first business subsystem in the at least one business subsystem can be dynamically modified. The first business subsystem can be any one or more of the at least one business subsystem. For example, for business subsystem A, modify its corresponding business authority configuration information, for example, modify the business authority configuration information including procurement supervision, URL path for querying document information, first parameter acquisition method, class name, and first method name to procurement supervision, URL path for querying document information, second parameter acquisition method, class name, and first method name. Since the verification rules can be modified dynamically, the change of business authority verification is convenient, and when the business subsystem caches the business authority configuration information accordingly, the timely change and invalidation of the business authority verification can be achieved.
[0110] Figure 2 A flowchart of a permission verification method provided according to an embodiment of the present specification is shown, which is applied to a business subsystem and specifically includes steps 202 to 210.
[0111] Step 202: Receive a service request to be verified from a user, where the service request carries the identity information and service identification information of the user.
[0112] The user logs in to the procurement platform with an account and initiates a business request. The user's business request is intercepted by the permission-checking access interceptor before entering the business code, and the business permission is checked first. Business requests are requests for businesses in the business subsystem, such as querying document information, creating purchase orders, etc. Business requests carry identity information and business identification information. The identity information represents the identity of the user, such as the operator, procurement supervision, zoning administrator, procurement unit, etc. The business identification information represents the type of business requested by the user, such as querying document information, creating purchase orders, etc.
[0113] In one embodiment, before performing the business authority verification, the platform authority verification is first performed, and the visitor is divided into identity types such as the operator, procurement supervision, zoning administrator, and procurement unit according to the login account, and then according to the different authority codes carried by different identity types, it can be determined whether the account has the authority to perform the business. An access interceptor for platform authority verification can be added in the form of a software development kit (SDK), and the business request can be intercepted before entering the business code to perform platform authority verification. Figure 3 FIG. 1 shows a schematic diagram of the overall process of a business subsystem provided according to an embodiment of the present specification. Figure 3 As shown, after starting in step 301, receiving data request 302, the business subsystem first performs platform permission check 303, and then performs business permission check 304. After the business permission check passes, it enters the business logic processing, namely the business code 305. After the business code is executed, data 306 is returned and the end 307 is ended. Among them, the platform permission check 303, the business permission check 304, and the business code 305 are separate modules respectively. Before executing the business code, the permission check is performed in advance, so that the business code is simple and easy to maintain.
[0114] In one embodiment, the service request is to access a resource path related to a service type for which permission verification is performed, wherein different resource paths represent different service types. The resource path may include a URL path. In the case where the service request is to access a URL path, the service identification information may be in the form of a URL path.
[0115] Step 204: According to the identity information and the service identification information, obtain target service authority configuration information corresponding to the identity information and the service identification information.
[0116] When the business subsystem is started, the latest business authority configuration information corresponding to the identification information is obtained from the business configuration subsystem according to the identification information of the business subsystem, and is cached in the business subsystem. Alternatively, at a preset time interval, the latest business authority configuration information corresponding to the identification information is obtained from the business configuration subsystem according to the identification information of the business subsystem, and is cached in the business subsystem. In one embodiment, when the business subsystem is started, a timer task is started to obtain the latest business authority configuration information from the business configuration subsystem at a fixed time. Afterwards, the business subsystem obtains the target business authority configuration information corresponding to the identity information and the business identification information from the cached business authority configuration information.
[0117] Step 206: Obtain a target verification method corresponding to the class name and method name in the target business authority configuration information.
[0118] Step 206 can be implemented by: extracting the class name and method name in the target business authority configuration information; obtaining the verification method corresponding to the class name in the object manager; and obtaining the target verification method corresponding to the method name in the verification method.
[0119] In one embodiment, the object manager is a Spring container, which stores many class instances. Multiple verification methods corresponding to the class name in the target business authority configuration information are obtained in the Spring container, and a target verification method named as the method name is obtained according to the method name in the target business authority configuration information.
[0120] Step 208: Using the target service parameters in the service request as input parameters of the target verification method, the target verification method is called.
[0121] The target business parameter is the target field for permission verification in the business parameter input by the user. For example, for a document query URL, the target business parameter is the ID of the document. The ID of the document is used as the input parameter of the target verification method, and the target verification method is called. In one embodiment, the target business permission configuration information also includes a target parameter acquisition method. Before step 208, the target business parameter is obtained from the business request using the target parameter acquisition method. Then, the target business parameter is used as the input parameter of the target verification method and called.
[0122] Step 210: Determine whether the permission check passes according to the call result of the target verification method, and if so, execute subsequent business logic processing.
[0123] In one embodiment, the result of calling the target verification method can be a Boolean value, indicating whether the permission verification has passed. Subsequent business logic processing is the real logic processing (business code) for different businesses. For example, in the case of querying document information, the document contains more information. When the document information is found, the information will be assembled, data splicing will be performed, or other business logic will be set, such as viewing document details, etc. This process is the subsequent business logic processing.
[0124] The permission verification method according to this embodiment realizes the separation of the logic of business permission verification from subsequent business logic processing. Before executing subsequent business logic processing, business permission verification is performed in advance, making the code of subsequent business logic processing simple and easy to maintain.
[0125] In one embodiment, if the permission check fails, an error message is returned to remind the user that he does not have permission to access the service type.
[0126] In another embodiment, if the target business authority configuration information corresponding to the user's identity information and business identification information is not obtained, the preset default business authority configuration information is obtained; the target business parameter in the business request is used as the input parameter of the default verification method corresponding to the default business authority configuration information, and the default verification method is called; according to the call result of the default verification method, it is determined whether the authority verification passes, and if it passes, the subsequent business logic processing is executed. If the preset default business authority configuration information is not obtained, it indicates that the business type does not need to perform business authority verification, and the subsequent business logic processing is directly executed.
[0127] The business configuration subsystem creates default business authority configuration information for certain combinations of identity information and business identification information. If the business subsystem does not obtain the target business authority configuration information corresponding to certain combinations of identity information and business identification information, it obtains the default business authority configuration information. If the default business authority configuration information is not obtained, the business configuration subsystem sets the combination to not require business authority verification.
[0128] The following combination Figure 4 Taking the application of the permission verification method provided in this specification to query document information on the procurement platform as an example, the permission verification method is further explained. Figure 4 A processing flow chart of a method for verifying the authority of querying document information on a procurement platform provided in an embodiment of the present specification is shown, which specifically includes steps 402 to 418.
[0129] Step 402: Receive a URL request from a user to access a query document, where the request carries the user's purchaser identity information and the query document's business identification information.
[0130] Step 404: When the business subsystem is started, a scheduled task is started to periodically pull the latest business authority configuration information from the business configuration subsystem and cache it locally.
[0131] Step 406: Obtain target business authority configuration information corresponding to the purchaser identity information and the business identification information of the query document from the cached business authority configuration information.
[0132] Step 408: extract the class name and method name in the target business authority configuration information, obtain multiple verification methods corresponding to the class name in the Spring container, and obtain the target verification method corresponding to the method name in the target business authority configuration information among the verification methods.
[0133] Step 410: Obtain the document ID from the URL request using the target parameter acquisition method in the target business authority configuration information.
[0134] Step 412: Use the document ID as an input parameter of the target verification method and call the target verification method.
[0135] Step 414: Determine whether the permission check passes according to the call result of the target verification method.
[0136] If the permission check passes, subsequent business logic processing such as document data splicing is performed in step 416. If the permission check fails, an error message is returned in step 418.
[0137] The permission verification method according to this embodiment realizes the separation of the logic of URL request permission verification from the subsequent business logic processing. Before executing the subsequent business logic processing, the permission verification of the URL request is performed in advance, making the code of the subsequent business logic processing simple and easy to maintain.
[0138] Figure 5 FIG. 1 shows a schematic diagram of a system for verifying permissions provided by an embodiment of the present specification. Figure 5 As shown, the permission verification system includes:
[0139] The business configuration subsystem 502 is configured to: determine the business type that needs to be verified for authority in each business subsystem of at least one business subsystem; create multiple business authority configuration information for the identity type and business type of different users of each business subsystem of the at least one business subsystem;
[0140] At least one business subsystem 504 is configured to: receive a business request to be verified from a user, the business request carrying the identity information and business identification information of the user; obtain, based on the identity information and the business identification information, target business authority configuration information corresponding to the identity information and the business identification information in the business authority configuration information created by the business configuration subsystem; obtain a target verification method corresponding to the class name and method name in the target business authority configuration information; use the target business parameters in the business request as input parameters of the target verification method, and call the target verification method; determine whether the permission verification passes based on the calling result of the target verification method, and if passed, execute subsequent business logic processing.
[0141] The permission verification system according to the present embodiment implements corresponding business permission configuration information for different business subsystems, that is, the corresponding business permission verification logic, so that the verification rules of the business permissions of each business subsystem are clearer, and the logic of business permission verification is separated from the subsequent business logic processing. Before executing the subsequent business logic processing, the business permission verification is performed in advance, so that the code of the subsequent business logic processing is simple and easy to maintain.
[0142] Corresponding to the above-mentioned service authority configuration method embodiment, this specification also provides a service authority configuration device embodiment, which is applied to a service configuration subsystem. Figure 6 FIG. 1 shows a schematic diagram of the structure of a service authority configuration device provided in an embodiment of this specification. Figure 6 As shown, the device comprises:
[0143] A determination module 602 is configured to determine a business type for which permission verification is required for each business subsystem in at least one business subsystem;
[0144] The first creation module 604 is configured to create a plurality of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem.
[0145] The service authority configuration device according to this embodiment can configure corresponding service authority configuration information, ie, corresponding service authority verification logic, for different service subsystems, so that the verification rules of the service authority of each service subsystem are clearer.
[0146] Optionally, the first creation module 604 is further configured to:
[0147] Determine a resource path related to a business type for which each business subsystem in the at least one business subsystem needs to perform permission verification, wherein different resource paths represent different business types;
[0148] Create different class and method names for different combinations of identity types and resource paths;
[0149] Each identity type, resource path, class name, and method name is used as business permission configuration information.
[0150] Optionally, the first creation module 604 is further configured to:
[0151] Determine a resource path related to a business type that requires permission verification for each business subsystem in the at least one business subsystem, wherein different resource paths represent different business types;
[0152] Define different parameter acquisition methods for different resource paths;
[0153] Create different class and method names for different combinations of identity types and resource paths;
[0154] Each identity type, resource path, parameter acquisition method, class name, and method name are used as business permission configuration information.
[0155] Optionally, the service authority configuration device further includes:
[0156] The second creation module is configured to create default business authority configuration information for a combination of a preset identity type and a resource path, wherein the default business authority configuration information includes a method name of a default verification method.
[0157] Optionally, the service authority configuration device further includes:
[0158] The modification module is configured to dynamically modify at least one of the multiple business authority configuration information corresponding to the first business subsystem in the at least one business subsystem.
[0159] Optionally, the service authority configuration device further includes:
[0160] The storage module is configured to store the service authority configuration information in a configuration table.
[0161] The above is a schematic scheme of a service authority configuration device of this embodiment. It should be noted that the technical scheme of the service authority configuration device and the technical scheme of the above service authority configuration method belong to the same concept, and the details not described in detail in the technical scheme of the service authority configuration device can be found in the description of the technical scheme of the above service authority configuration method.
[0162] Corresponding to the above-mentioned permission verification method embodiment, this specification also provides a permission verification device embodiment, which is applied to a business subsystem. Figure 7 FIG. 1 shows a schematic diagram of a structure of a permission verification device provided by an embodiment of this specification. Figure 7 As shown, the device comprises:
[0163] The receiving module 702 is configured to receive a service request to be verified from a user, wherein the service request carries the identity information and service identification information of the user;
[0164] A first acquisition module 704 is configured to acquire target service authority configuration information corresponding to the identity information and the service identification information according to the identity information and the service identification information;
[0165] The second acquisition module 706 is configured to acquire a target verification method corresponding to the class name and method name in the target business authority configuration information;
[0166] A calling module 708 is configured to use the target service parameter in the service request as an input parameter of the target verification method and call the target verification method;
[0167] The determination module 710 is configured to determine whether the permission check is passed according to the call result of the target verification method, and if passed, perform subsequent business logic processing.
[0168] The authority verification device according to this embodiment realizes the separation of the logic of business authority verification from subsequent business logic processing. Before executing subsequent business logic processing, business authority verification is performed in advance, making the code of subsequent business logic processing simple and easy to maintain.
[0169] Optionally, the target service authority configuration information also includes a target parameter acquisition method, and the authority verification device also includes:
[0170] The third acquisition module is configured to acquire the target service parameter from the service request by using the target parameter acquisition method.
[0171] Optionally, the authority verification device further includes:
[0172] The first cache module is configured to obtain the latest business authority configuration information corresponding to the identification information from the business configuration subsystem according to the identification information of the business subsystem when the business subsystem is started, and cache it in the business subsystem.
[0173] Optionally, the authority verification device further includes:
[0174] The second cache module is configured to obtain the latest business authority configuration information corresponding to the identification information from the business configuration subsystem at a preset time interval according to the identification information of the business subsystem, and cache it in the business subsystem.
[0175] Optionally, the second acquisition module is further configured to:
[0176] Extract the class name and method name in the target business authority configuration information;
[0177] Obtaining a verification method corresponding to the class name in the object manager;
[0178] Obtain a target verification method corresponding to the method name in the verification method.
[0179] Optionally, the authority verification device further includes:
[0180] The return module is configured to return an error message if the permission check fails.
[0181] Optionally, the authority verification device further includes:
[0182] a fourth acquisition module, configured to acquire preset default business authority configuration information if target business authority configuration information corresponding to the identity information and the business identification information is not acquired;
[0183] A default verification method calling module is configured to use the target service parameter in the service request as an input parameter of the default verification method corresponding to the default service authority configuration information, and call the default verification method;
[0184] The result determination module is configured to determine whether the permission check is passed according to the call result of the default verification method, and if passed, execute subsequent business logic processing.
[0185] Optionally, the authority verification device further includes:
[0186] The processing execution module is configured to execute subsequent business logic processing if the preset default business authority configuration information is not obtained.
[0187] The above is a schematic scheme of a permission verification device of this embodiment. It should be noted that the technical scheme of the permission verification device and the technical scheme of the permission verification method described above are of the same concept, and the details not described in detail in the technical scheme of the permission verification device can be found in the description of the technical scheme of the permission verification method described above.
[0188] Figure 8 The structure block diagram of a computing device 800 provided according to an embodiment of the present specification is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0189] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0190] In one embodiment of the present specification, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0191] The computing device 800 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 800 may also be a mobile or stationary server.
[0192] The processor 820 is used to execute the following computer executable instructions to implement the following method:
[0193] Receiving a service request to be verified from a user, the service request carrying identity information and service identification information of the user;
[0194] According to the identity information and the service identification information, obtaining target service authority configuration information corresponding to the identity information and the service identification information;
[0195] Obtain a target verification method corresponding to the class name and method name in the target business authority configuration information;
[0196] Using the target service parameter in the service request as an input parameter of the target verification method, and calling the target verification method;
[0197] According to the calling result of the target verification method, determine whether the permission verification passes. If passed, execute subsequent business logic processing.
[0198] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned permission verification method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned permission verification method.
[0199] In one embodiment, the processor 820 is configured to execute the following computer executable instructions to implement the following method:
[0200] Determine the business type that needs to be subject to authority verification for each business subsystem in at least one business subsystem;
[0201] A plurality of business authority configuration information is created for identity types and business types of different users of each business subsystem in the at least one business subsystem.
[0202] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned business authority configuration method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned business authority configuration method.
[0203] An embodiment of the present specification also provides a computer-readable storage medium storing computer instructions, which are used to execute the steps of the above-mentioned permission verification method when executed by a processor.
[0204] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned permission verification method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned permission verification method.
[0205] An embodiment of the present specification further provides a computer-readable storage medium storing computer instructions, which are used to execute the steps of the above-mentioned service authority configuration method when executed by a processor.
[0206] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned business authority configuration method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned business authority configuration method.
[0207] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0208] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0209] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that this specification is not limited by the order of the actions described, because according to this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this specification.
[0210] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0211] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A permission verification method, applied to a business subsystem, characterized in that: include: Receiving a service request to be verified from a user, the service request carrying identity information and service identification information of the user; According to the identity information and the business identification information, obtaining target business authority configuration information corresponding to the identity information and the business identification information, where different combinations of the identity information and the business identification information correspond to different class names and method names; Obtaining a target verification method corresponding to a class name and a method name in the target business authority configuration information, comprising: extracting the class name and the method name in the target business authority configuration information; obtaining a verification method corresponding to the class name in an object manager; obtaining a target verification method corresponding to the method name in the verification method; Acquire target service parameters from the service request using the target parameter acquisition method in the target service authority configuration information, wherein the target service parameters are target fields for authority verification in the service parameters input by the user; Using the target service parameter in the service request as an input parameter of the target verification method, and calling the target verification method; According to the calling result of the target verification method, determine whether the permission verification passes. If passed, execute subsequent business logic processing.
2. The permission verification method according to claim 1, characterized in that: Also includes: When the business subsystem is started, the latest business authority configuration information corresponding to the identification information is obtained from the business configuration subsystem according to the identification information of the business subsystem, and is cached in the business subsystem.
3. The permission verification method according to claim 1, characterized in that: Also includes: At preset time intervals, according to the identification information of the business subsystem, the latest business authority configuration information corresponding to the identification information is obtained from the business configuration subsystem, and cached in the business subsystem.
4. The permission verification method according to claim 1, characterized in that: Also includes: If the permission check fails, an error message is returned.
5. The permission verification method according to claim 1, characterized in that: Also includes: If the target service authority configuration information corresponding to the identity information and the service identification information is not obtained, obtaining the preset default service authority configuration information; Using the target service parameter in the service request as the input parameter of the default verification method corresponding to the default service authority configuration information, and calling the default verification method; According to the calling result of the default verification method, determine whether the permission verification passes, and if passed, execute subsequent business logic processing.
6. The permission verification method according to claim 5, characterized in that: Also includes: If the preset default business permission configuration information is not obtained, subsequent business logic processing is executed.
7. A business authority configuration method, applied to a business configuration subsystem, characterized in that: include: Determine the business type that needs to be subject to authority verification for each business subsystem in at least one business subsystem; Create multiple business permission configuration information for the identity type and business type of different users of each business subsystem in the at least one business subsystem, wherein the business permission configuration information includes a class name, a method name and a target parameter acquisition method, and different combinations of identity information and business identification information correspond to different class names and method names. The identity information represents the identity type of the user, and the business identification information represents the business type requested by the user. The class name and method name are used to obtain the corresponding target verification method, the class name is used to obtain the corresponding verification method in the object manager, the method name is used to obtain the target verification method corresponding to the method name in the verification method, and the target parameter acquisition method is used to obtain the target business parameters, and the target business parameters are used as input parameters to call the target verification method for permission verification.
8. The service authority configuration method according to claim 7, characterized in that: Creating a plurality of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem includes: Determine a resource path related to a business type for which each business subsystem in the at least one business subsystem needs to perform permission verification, wherein different resource paths represent different business types; Create different class and method names for different combinations of identity types and resource paths; Each identity type, resource path, class name, and method name is used as business permission configuration information.
9. The service authority configuration method according to claim 7, characterized in that: Creating a plurality of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem includes: Determine a resource path related to a business type for which each business subsystem in the at least one business subsystem needs to perform permission verification, wherein different resource paths represent different business types; Define different parameter acquisition methods for different resource paths; Create different class and method names for different combinations of identity types and resource paths; Each identity type, resource path, parameter acquisition method, class name, and method name are used as business permission configuration information.
10. The service authority configuration method according to claim 7 or 8, characterized in that: Also includes: Default business authority configuration information is created for a preset combination of identity type and resource path, wherein the default business authority configuration information includes a method name of a default verification method.
11. The service authority configuration method according to claim 7 or 8, characterized in that: Also includes: Dynamically modify at least one of the plurality of business authority configuration information corresponding to the first business subsystem in the at least one business subsystem.
12. The service authority configuration method according to claim 7 or 8, characterized in that: Also includes: The business authority configuration information is stored in a configuration table.
13. A permission verification system, characterized in that: include: The business configuration subsystem is configured to: determine a business type that requires permission verification for each business subsystem in at least one business subsystem; Creating a plurality of business authority configuration information for identity types and business types of different users of each business subsystem in the at least one business subsystem, wherein the business authority configuration information includes a class name, a method name, and a target parameter acquisition method; At least one business subsystem is configured to: receive a business request to be verified from a user, the business request carrying the identity information and business identification information of the user; obtain, according to the identity information and the business identification information, target business authority configuration information corresponding to the identity information and the business identification information in the business authority configuration information created by the business configuration subsystem, different combinations of the identity information and the business identification information correspond to different class names and method names; obtain a target verification method corresponding to the class name and method name in the target business authority configuration information, including: extracting the class name and method name in the target business authority configuration information; obtaining the verification method corresponding to the class name in the object manager; obtaining the target verification method corresponding to the method name in the verification method; obtaining a target business parameter from the business request using a target parameter acquisition method in the target business authority configuration information, wherein the target business parameter is a target field for permission verification in the business parameter input by the user; using the target business parameter in the business request as an input parameter of the target verification method, and calling the target verification method; determining whether the permission verification passes according to the calling result of the target verification method, and if so, executing subsequent business logic processing.
14. A permission verification device, applied to a business subsystem, characterized in that: include: A receiving module, configured to receive a service request to be verified from a user, wherein the service request carries the identity information and service identification information of the user; A first acquisition module is configured to acquire target business authority configuration information corresponding to the identity information and the business identification information according to the identity information and the business identification information, wherein different combinations of the identity information and the business identification information correspond to different class names and method names; The second acquisition module is configured to acquire a target verification method corresponding to the class name and method name in the target business authority configuration information, including: extracting the class name and method name in the target business authority configuration information; acquiring the verification method corresponding to the class name in the object manager; acquiring the target verification method corresponding to the method name in the verification method; A third acquisition module is configured to acquire a target business parameter from the business request using a target parameter acquisition method in the target business authority configuration information, wherein the target business parameter is a target field for authority verification in the business parameter input by the user; A calling module is configured to use the target service parameter in the service request as an input parameter of the target verification method and call the target verification method; The determination module is configured to determine whether the permission check passes according to the call result of the target verification method, and if passed, execute subsequent business logic processing.
15. A service authority configuration device, applied to a service configuration subsystem, characterized in that: include: A determination module is configured to determine a business type that requires permission verification for each business subsystem in at least one business subsystem; The first creation module is configured to create multiple business permission configuration information for the identity type and business type of different users of each business subsystem in the at least one business subsystem, wherein the business permission configuration information includes a class name, a method name and a target parameter acquisition method, and different combinations of identity information and business identification information correspond to different class names and method names. The identity information represents the identity type of the user, and the business identification information represents the business type requested by the user. The class name and method name are used to obtain the corresponding target verification method, the class name is used to obtain the corresponding verification method in the object manager, and the method name is used to obtain the target verification method corresponding to the method name in the verification method. The target parameter acquisition method is used to obtain the target business parameters, and the target business parameters are used as input parameters to call the target verification method for permission verification.
16. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the following method: Receiving a service request to be verified from a user, the service request carrying identity information and service identification information of the user; According to the identity information and the business identification information, obtaining target business authority configuration information corresponding to the identity information and the business identification information, where different combinations of the identity information and the business identification information correspond to different class names and method names; Obtaining a target verification method corresponding to a class name and a method name in the target business authority configuration information, comprising: extracting the class name and the method name in the target business authority configuration information; obtaining a verification method corresponding to the class name in an object manager; obtaining a target verification method corresponding to the method name in the verification method; Acquire target service parameters from the service request using the target parameter acquisition method in the target service authority configuration information, wherein the target service parameters are target fields for authority verification in the service parameters input by the user; Using the target service parameter in the service request as an input parameter of the target verification method, and calling the target verification method; According to the calling result of the target verification method, determine whether the permission verification passes. If passed, execute subsequent business logic processing.
17. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the following method: Determine the business type that needs to be subject to authority verification for each business subsystem in at least one business subsystem; Create multiple business permission configuration information for the identity type and business type of different users of each business subsystem in the at least one business subsystem, wherein the business permission configuration information includes a class name, a method name and a target parameter acquisition method, and different combinations of identity information and business identification information correspond to different class names and method names. The identity information represents the identity type of the user, and the business identification information represents the business type requested by the user. The class name and method name are used to obtain the corresponding target verification method, the class name is used to obtain the corresponding verification method in the object manager, the method name is used to obtain the target verification method corresponding to the method name in the verification method, and the target parameter acquisition method is used to obtain the target business parameters, and the target business parameters are used as input parameters to call the target verification method for permission verification.
18. A computer-readable storage medium, characterized in that: It stores computer instructions, which, when executed by a processor, implement the steps of the permission verification method described in any one of claims 1 to 6.
19. A computer-readable storage medium, characterized in that: It stores computer instructions, which, when executed by a processor, implement the steps of the business authority configuration method described in any one of claims 7 to 12.
Citation Information
Patent Citations
Business operation method and device, electronic equipment and storage medium
CN110795709A
Login authority verification method and device, server and storage medium
CN110866243A
Business data verification method and device
CN111444224A
Verification information processing method, communication device, service platform, and storage medium
WO2019134494A1
