Interface authority control system, method and electronic device
By connecting the authority control module to the gateway, the problem of reduced system flexibility caused by the encapsulation of the authority control module to the gateway level in the existing technology is solved, the centralized and unified microservice authority authentication is realized, and the versatility and controllability of the gateway are improved. .
Patent Information
- Application Number
- CN202210113888.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-30
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2042-01-30
AI Technical Summary
In the existing technology, encapsulating the permission control module at the gateway level results in reduced system flexibility, making it impossible to modify and update in time according to user needs or service requirements, and encapsulating permission control at the application level results in a waste of resources.
Design an interface permission control system that connects the permission control module to the gateway, uses the gateway to receive HTTP requests and determines whether they meet the preset conditions, adds qualified request routing information and sends it to the permission control module for interface permission verification. Access the microservice application module through the interface that passes the verification.
It realizes the centralized unification of microservice authority authentication, improves the versatility and controllability of the gateway, and avoids the problems of resource waste and reduced flexibility.
Smart Images

Figure CN114465996B
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of software development technology, and in particular to an interface authority control system, method and electronic device. Background Art
[0002] With the advancement of the Internet and cloud computing, microservices are gaining more and more attention from practitioners. Microservices solve the problem of complexity and can decompose a whole program into a set of services, each of which can be deployed and adjusted independently. While the microservice architecture brings convenience to people, it also poses a challenge to the unified authority control of the system. There are problems such as different functions and unclear positioning between microservice applications, and it is impossible to accurately obtain the corresponding interface permissions and interface information.
[0003] Figure 1 A schematic diagram of an interface authority control device in the prior art is shown in FIG. Figure 1 As shown in the figure, permission control is encapsulated at the microservice application level, and the microservice application module independently develops permission control; Figure 2 FIG. 1 is a schematic diagram of another interface authority control device in the prior art, such as Figure 2 As shown in the figure, permission control is encapsulated at the gateway level, and permission control is combined with the inherent functions of the gateway to achieve control of microservice application interface permissions.
[0004] In the above-mentioned prior art, encapsulating permission control at the gateway level will reduce the flexibility of the device, and permission control cannot be modified and updated in time according to user needs or service needs; encapsulating permission control at the application level makes one microserver correspond to one permission control, resulting in waste of resources. Summary of the invention
[0005] The present invention provides an interface authority control system, method and electronic device to solve the problem of inconsistent authority authentication of microservices on an e-commerce platform.
[0006] According to one aspect of the present invention, an interface authority control system is provided, comprising a gateway, an authority control module and a microservice application module, wherein the gateway, the authority control module and the microservice application module are connected in pairs;
[0007] The gateway is used to receive an HTTP request, determine whether the HTTP request meets a preset condition, add request routing information to a first HTTP request that meets the preset condition, and then send the first HTTP request to the authority control module;
[0008] The permission control module is used to perform interface permission verification according to the first HTTP request, and access the corresponding microservice application in the microservice application module through the interface that passes the verification.
[0009] According to another aspect of the present invention, there is provided an interface authority control method, which is executed by the authority control module provided by any embodiment of the present invention, and the method includes:
[0010] Acquire a first HPPT request from a filtering module of the gateway, where the first HPPT request is an HPPT request that meets a preset condition;
[0011] Performing interface authority verification according to the first HTTP request;
[0012] Access the corresponding microservice application through the interface that has passed the verification.
[0013] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising: at least one processor; and
[0014] a memory communicatively connected to the at least one processor; wherein,
[0015] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface authority control method described in any embodiment of the present invention.
[0016] According to another aspect of the present invention, a computer readable storage medium is provided.
[0017] The readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interface authority control method described in any embodiment of the present invention when executed.
[0018] The technical solution of the embodiment of the present invention solves the problem of reduced system flexibility caused by encapsulating the permission control module at the gateway level in the prior art by connecting the permission control module to the gateway, achieves the beneficial effect of being able to realize the centralized unification of microservice permission authentication and improving the versatility and controllability of the gateway.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 It is a schematic diagram of an interface authority control device in the prior art;
[0022] Figure 2 It is a schematic diagram of another interface authority control device in the prior art;
[0023] Figure 3 A schematic diagram of the structure of an interface authority control system provided in the first embodiment of the present invention;
[0024] Figure 4 A schematic diagram of an API gateway provided in Embodiment 1 of the present invention;
[0025] Figure 5 A schematic diagram of the structure of an interface authority control system provided by Embodiment 2 of the present invention;
[0026] Figure 6 A schematic diagram of the structure of an authority control module in an interface authority control system provided in Embodiment 2 of the present invention;
[0027] Figure 7 A flowchart of an interface authority control method provided in Embodiment 3 of the present invention;
[0028] Figure 8 A schematic diagram of the structure of an electronic device of the interface authority control method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only an embodiment of a part of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work should belong to the scope of protection of the present invention. It should be understood that the various steps recorded in the method implementation of the present invention can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0030] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.
[0034] Embodiment 1
[0035] Figure 3 This is a structural diagram of an interface permission control system provided in Example 1 of the present invention. The system can be applied to microservice application permission control, and is particularly suitable for e-commerce platform interface permission control, wherein the interface permission control system can be implemented by software and / or hardware, and the interface permission control system can include a permission control module to achieve centralized and unified microservice permission authentication.
[0036] like Figure 3 As shown, an interface authority control system provided by the first embodiment of the present invention includes a gateway 110, an authority control module 120 and a microservice application module 130, wherein the gateway 110, the authority control module 120 and the microservice application module 130 are connected in pairs;
[0037] The gateway 110 is used to receive an HTTP request, determine whether the HTTP request meets a preset condition, add the request routing information to a first HTTP request that meets the preset condition, and then send the first HTTP request to the authority control module 120;
[0038] The permission control module 120 is used to perform interface permission verification according to the first HTTP request, and access the corresponding microservice application in the microservice application module 130 through the interface that passes the verification.
[0039] In this embodiment, the gateway 110 may be an API gateway, and the gateway 110 may be used to receive external system requests, or receive requests from users, and forward the requests to different microservice applications through an interface.
[0040] Figure 4 A schematic diagram of an API gateway provided in the first embodiment of the present invention is shown as follows: Figure 4 As shown, the API gateway in the prior art can serve as the only entrance to the entire system. The API gateway encapsulates the internal architecture of the entire system and provides an API information for all user ends or consumer ends. Different microservice applications are accessed through the API. For example, microservice applications can include order services, product services, merchant services, and promotion services.
[0041] In this embodiment, the gateway 110 can be used to receive an HTTP request and determine whether the HTTP request meets a preset condition, wherein the HTTP request can be understood as a request message from a client to a server. The preset condition can be set according to demand or scenario, and illustratively, the preset condition can include that the address of the HTTP request is the same as the preset address.
[0042] In this embodiment, after determining the first HTTP request, the gateway 110 may add the request routing information to the first HTTP request, wherein the request routing information may be added to the request header information of the first HTTP request.
[0043] In this embodiment, the gateway 110 can be used to send the first HTTP request including the request routing information to the authority control module 120 by wirelessly connecting to the authority control module 120, so that the authority control module can perform interface authority verification according to the first HTTP request.
[0044] Furthermore, the gateway 110 is further configured to access the microservice application in the microservice application module 130 through the interface corresponding to the second HTTP request that does not meet the preset condition.
[0045] Among them, the HTTP request that meets the preset conditions can be used as the second HTTP request.
[0046] In this embodiment, the gateway 110 can also be wirelessly connected to the microservice application module 130 to obtain the corresponding API interface through a second HTTP request, and access the microservice application corresponding to the second HTTP request included in the microservice application module 130 through the API interface.
[0047] In this embodiment, the permission control module 120 can be a module for controlling interface permissions. Permission control is an access control technology that performs identity authentication and access control based on filtering protection rules defined by developers or users and combined with configuration information of the configuration center. It can meet access control requirements in most environments.
[0048] Among them, the permission control module 120 can be used to obtain the first HTTP request sent by the gateway 110 through a wireless connection with the gateway 110; the permission control module 120 can be used to perform interface permission verification based on the request header information and request routing information included in the first HTTP request; the permission control module 120 can also be connected to the microservice application module 130 to access the corresponding microservice application in the microservice application module through a verified interface.
[0049] If the interface permission check fails, the check failure is returned, indicating that the microservice application module cannot be accessed.
[0050] Furthermore, the microservice application module 130 includes multiple microservice applications, and each microservice application corresponds to different interface permissions.
[0051] Exemplarily, microservice applications may include order services, product services, merchant services, and promotion services.
[0052] In this embodiment, the microservice application module 130 may include multiple microservice applications. These small microservice applications run independently and occupy their own processes. Each service can be independently deployed, maintained, and expanded. The services communicate with each other through HTTP's Restful API and collaborate to achieve the functions of the entire system. Each microservice is independent of each other in terms of development, application, and maintenance, executes a set of specialized business process logic, and usually has its own data storage.
[0053] Furthermore, the system can be implemented through a component-based development approach.
[0054] In this embodiment, the modules can be combined based on Spring Cloud to implement the interface permission control function. Among them, Spring Cloud is an ordered collection of a series of frameworks. It uses the development convenience of Spring Boot to cleverly simplify the development of distributed system infrastructure, such as service discovery registration, configuration center, message bus, load balancing, circuit breaker, data monitoring, etc., which can be started and deployed with one click using the Spring Boot development style.
[0055] An interface permission control system provided in the first embodiment of the present invention first receives an HTTP request through a gateway 110, determines whether the HTTP request meets a preset condition, adds request routing information to a first HTTP request that meets the preset condition, and then sends the first HTTP request to a permission control module 120; then, the permission control module 120 performs an interface permission check according to the first HTTP request, and accesses the corresponding microservice application in the microservice application module 130 through the interface that passes the check. The above system is implemented based on a componentized development method, can respond to requests from the perspective of system security and reliability, can realize the centralized and unified microservice permission authentication, and improves the versatility and controllability of the gateway.
[0056] Embodiment 2
[0057] Figure 5 The schematic diagram of the structure of an interface authority control system provided by the second embodiment of the present invention is optimized on the basis of the above embodiments. In this embodiment, the gateway 110 includes a filtering module 111, the filtering module 111 is connected to the authority control module 120, and the filtering module 111 is used to determine whether the HTTP request meets the preset conditions according to the address information of the HTTP request.
[0058] The filtering module 111 is provided in the gateway 110 , and the filtering module 111 in the gateway 110 can determine whether the HTTP request meets the preset condition, and filter out the second HTTP request that does not meet the preset condition.
[0059] The filtering module 111 in the embodiment of the present invention can filter out HTTP requests that do not require interface authority control by filtering HTTP requests, thereby improving the processing efficiency of the authority control module and avoiding resource waste.
[0060] Furthermore, the filtering module 111 is specifically used to: when the address of the HTTP request is the same as the preset address, determine that the HTTP request meets the preset condition; when the address of the HTTP request is different from the preset address, determine that the HTTP request does not meet the preset condition.
[0061] In this embodiment, whether the HTTP request meets the preset condition can be determined by the address of the HTTP request. It should be noted that whether the HTTP request meets the preset condition can also be determined by other feasible methods, which are not given one by one here.
[0062] In the prior art, the permission control module is directly encapsulated into the gateway layer, and the permission control is combined with the inherent function of the gateway, which reduces the flexibility of the entire device and cannot be modified and updated in time according to the needs of users or services. In this embodiment, the permission control module 120 is connected to the filtering module 111 in the gateway 110. Here, the permission control module 120 is an independently operated module that can be modified at will according to user needs or service needs, will not be restricted by the gateway, and will not affect the flexibility of the device.
[0063] Furthermore, the permission control module 120 includes a request receiving submodule 121, a permission verification submodule 122 and a configuration submodule 123; the request receiving submodule 121 is used to receive the first HTTP request, and obtain request routing information and request header information from the first HTTP request; the permission verification submodule 122 is used to obtain user information and interface permission information from the cache database according to the request header information, and obtain configuration information from the configuration submodule 123 according to the request routing information, and the configuration information includes request routing, interface permission code and user login tag; the permission verification submodule 122 is also used to verify the interface permission information according to the interface permission code, and determine the user's login status according to the user login tag and the user information.
[0064] The cache database may be a redis database, which is a key-value storage system. Redis is a NoSQL database whose data is stored in memory. At the same time, redis can synchronize memory data to disk at regular intervals, that is, it can make data persistent.
[0065] The user information may be determined according to specific needs or scenarios. For example, the user information may include a user name, a user ID, and information after the user logs in. The permission information may be understood as the user's permission to access the microservice application.
[0066] In this embodiment, the request receiving submodule 121, the permission checking submodule 122 and the configuration submodule 123 can be connected in communication. Among them, the configuration submodule 122 can be a configuration center, which can be understood as the center of configuration information of all services on all servers. The configuration of all services is stored in a database or other storage device through the configuration center, and each service component pulls its own configuration information from the configuration center. The configuration submodule 122 may include multiple configuration information, and different configuration information corresponds to different HTTP requests.
[0067] The method of acquiring the configuration information from the configuration submodule 122 according to the request routing information may be: determining the configuration information including the request routing from the configuration submodule 122 according to the request routing information.
[0068] Among them, verifying the interface permission information according to the interface permission code includes: if the interface permission code corresponds to the interface permission information, the verification passes; if the interface permission code does not correspond to the interface permission information, the verification fails.
[0069] Among them, judging the user's login status according to the user login mark and user information may include: searching for the user's login mark according to the user information, and determining the user's login status according to the user login mark.
[0070] Furthermore, the configuration submodule 123 is used to store the request route, the user login mark and the interface permission code in a one-to-one correspondence in a database of the configuration submodule 123 , so that the permission verification submodule 122 obtains configuration information from the database of the configuration submodule 123 .
[0071] Figure 6 This is a schematic diagram of the structure of the authority control module in the interface authority control system provided in the second embodiment of the present invention. Figure 6 As shown, the permission control module includes a request receiving submodule, a permission checking submodule and a configuration submodule. Among them, the request obtaining submodule is responsible for obtaining the request routing information and request header information of the first HTTP request. The specific process includes: obtaining the request routing information from the request header information after receiving the first HTTP request, and sending the request header information and the request routing information to the permission checking submodule. Among them, the permission checking submodule is responsible for verifying the user login permission and access interface permission information. The specific process includes: obtaining the user information and permission information stored in the redis database according to the request header information of the first HTTP request; using the request routing information of the first HTTP request to obtain the configuration information in the configuration submodule; verifying the user login status and permission information according to the configuration information, if the verification passes, it returns success, if the verification fails, it returns failure. Among them, the configuration submodule 123 is responsible for maintaining the relationship between the request route, login mark and interface permission code, specifically, maintaining the request route and login mark in the database; maintaining the request route and interface permission code in the database; maintaining the one-to-one correspondence between the request route, login mark and interface permission code.
[0072] The interface authority control system provided by the second embodiment of the present invention concretizes the filtering module and the authority control module. With this system, the HPPT request can be filtered through the filtering module, and the login identity and authority authentication can be performed in combination with the configuration submodule, thereby enhancing the security of the application architecture upgrade and improving the versatility and controllability of the gateway.
[0073] Embodiment 3
[0074] Figure 7This is a flow chart of an interface permission control method provided in Example 3 of the present invention. The method can be applicable to microservice application permission control, and is particularly applicable to e-commerce platform interface permission control. The method can be executed by a permission control module, wherein the module can be implemented by software and / or hardware and is generally integrated on an electronic device.
[0075] like Figure 7 As shown, a method for controlling interface permissions provided by Embodiment 3 of the present invention includes the following steps:
[0076] S110. Obtain a first HPPT request from a filtering module of the gateway, where the first HPPT request is an HPPT request that meets a preset condition.
[0077] The permission control module for executing the method is a module independent of the gateway, and the module communicates with the gateway through the filtering module in the gateway.
[0078] Among them, the preset condition can be set in advance, and the preset condition can be set according to the specific situation. For example, the preset condition can include a preset address. It can be understood that if the address of the HPPT request is the same as the preset address, it means that the HPPT request is the first HPPT request.
[0079] The manner of obtaining the first HPPT request is not limited here, and a feasible manner may be: obtaining the first HPPT request from a filtering module of the gateway.
[0080] S120. Perform interface authority verification according to the first HTTP request.
[0081] In this embodiment, the corresponding microservice application can be accessed through the interface only after the interface permission verification is passed.
[0082] Specifically, the process of performing interface permission verification based on the first HPPT request may include: obtaining request routing information and request header information from the first HPPT request; obtaining user information and interface permission information from the cache database based on the request header information, and obtaining configuration information based on the request routing information; verifying the interface permission information based on the interface permission code, and determining the user's login status based on the user login mark and user information.
[0083] The configuration information may include a request route, an interface permission code, and a user login mark, and the request route, the interface permission code, and the user login mark are in a one-to-one correspondence.
[0084] S130. Access the corresponding microservice application through the interface that has passed the verification.
[0085] If the interface permission check fails, the check failure is returned, indicating that the corresponding microservice application cannot be accessed through the interface.
[0086] The third embodiment of the present invention provides an interface permission control method, which first obtains a first HPPT request from a filtering module of a gateway, wherein the first HPPT request is an HPPT request that meets preset conditions; then performs an interface permission check according to the first HTTP request; and finally accesses the corresponding microservice application through the interface that passes the check. This method can realize the response to the HPPT request from the perspective of system security and reliability, realize the centralized and unified microservice permission authentication, and improve the versatility and controllability of the gateway.
[0087] Embodiment 4
[0088] Figure 8 A schematic diagram of the structure of an electronic device 10 that can be used to implement an interface authority control method of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0089] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0090] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0091] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as an interface authority control method.
[0092] In some embodiments, an interface permission control method is implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the interface permission control method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute an interface permission control method in any other appropriate manner (e.g., by means of firmware).
[0093] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0094] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0095] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0096] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0097] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0098] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0100] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An interface authority control system, characterized in that: The system includes a gateway, a permission control module and a microservice application module, wherein the gateway, the permission control module and the microservice application module are connected in pairs; The gateway is used to receive an HTTP request, determine whether the HTTP request meets a preset condition, add request routing information to a first HTTP request that meets the preset condition, and then send the first HTTP request to the authority control module; The preset condition is that the address of the HTTP request is the same as the preset address; The permission control module is used to perform interface permission verification according to the first HTTP request, and access the corresponding microservice application in the microservice application module through the interface that passes the verification; Wherein, the permission control module includes a request receiving submodule, a permission checking submodule and a configuration submodule; The request receiving submodule is used to receive the first HTTP request, and obtain request routing information and request header information from the first HTTP request; The permission verification submodule is used to obtain user information and interface permission information from the cache database according to the request header information, and obtain configuration information from the configuration submodule according to the request routing information, wherein the configuration information includes the request routing, the interface permission code and the user login mark; The permission verification submodule is further used to verify the interface permission information according to the interface permission code, and determine the user's login status according to the user login mark and the user information; The gateway comprises a filtering module, the filtering module is connected to the authority control module, and the filtering module is used to determine whether the HTTP request meets a preset condition according to the address information of the HTTP request.
2. The system according to claim 1, characterized in that The microservice application module includes multiple microservice applications, and each microservice application corresponds to a different interface permission.
3. The system according to claim 1, characterized in that The gateway is also used to allow the interface corresponding to the second HTTP request that does not meet the preset condition to access the microservice application in the microservice application module.
4. The system according to claim 1, characterized in that The filtering module is specifically used to: when the address of the HTTP request is the same as the preset address, determine that the HTTP request meets the preset condition; when the address of the HTTP request is different from the preset address, determine that the HTTP request does not meet the preset condition.
5. The system according to claim 1, characterized in that The configuration submodule is used to store the request route, the user login mark and the interface permission code in a database of the configuration submodule in a one-to-one correspondence, so that the permission verification submodule obtains configuration information from the database of the configuration submodule.
6. The system according to claim 1, characterized in that The system is implemented through a component-based development approach.
7. An interface authority control method, characterized in that: Executed by the permission control module as claimed in claim 1, the method comprises: Acquire a first HPPT request from a filtering module of the gateway, the filtering module is connected to the authority control module, the first HPPT request is an HPPT request that meets a preset condition; the preset condition is that the address of the HTTP request is the same as the preset address; Performing interface authority verification according to the first HTTP request; Access the corresponding microservice application through the interface that has passed the verification; Among them, the process of performing interface permission verification according to the first HPPT request includes: obtaining request routing information and request header information from the first HPPT request; obtaining user information and interface permission information from the cache database according to the request header information, and obtaining configuration information according to the request routing information; verifying the interface permission information according to the interface permission code, and determining the user's login status according to the user login mark and user information.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface authority control method described in claim 7.
