Micro-service access control method and device based on dubbo framework

By adding access authentication filters and identity verification filters to the Dubbo framework, and using application name information and whitelists, more precise microservice access control is achieved, which solves the problem that access can only be controlled through IP restrictions in Dubbo version 2.5. Improved system security and maintainability.

CN118694566APending Publication Date: 2024-09-24INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Application Number
CN202410701483.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Microservice access control in Dubbo version 2.5 can only be restricted by IP, and cannot be refined based on more contextual information. As a result, after the system scale expands and the network structure changes, the maintenance of IP whitelists or exception lists is difficult and error-prone.

Method used

By adding access authentication filters and identity authentication filters to the Dubbo framework, more precise access control can be achieved using application name information and pre-configured application whitelists. Custom Filters can implement whitelist or exception list access control mechanisms to reject exclusions. All calls except specific applications or only allow calls from specific applications.

Benefits of technology

Significantly improves the security and maintainability of access control, reduces the risk of unauthorized access and attacks, provides more refined and flexible access control decisions, and improves the security of service calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The invention provides a dubbo framework-based micro-service access control method and device, and relates to the technical field of information security, and the method comprises the steps of determining a target calling link corresponding to an access request in response to the received access request from a service consumer; determining application name information and target to-be-called interface information of the service consumer according to the target calling link, and determining a target service provider according to the target to-be-called interface information; obtaining an access authentication filter pre-configured by the target service provider, and determining whether the access request is valid based on the access authentication filter and the application name information; and calling a service provider interface corresponding to the target to-be-called interface information in response to the fact that the access request is valid. According to the method, the defects in the existing access control mechanism technology can be overcome, and the micro-service access control method which is easy to implement, high in expansibility and capable of achieving more accurate micro-service access control is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, in particular to the field of microservice technology, and can also be used in the financial field. Specifically, it relates to a microservice access control method and device based on the dubbo framework. Background Art

[0002] With the development of distributed technology, bank IT systems are also gradually using distributed architecture. In the application solution of the bank system, the service provider exposes the service in the registration center, and the consumer subscribes to the service they need from the registration center. However, in some cases, the service provider does not want to expose the service provided by the service provider to other systems. Therefore, it is necessary to control the interface permissions on the service provider to clarify which products can call the interface service.

[0003] In the prior art, Apache Dubbo is an open source, high-performance service framework developed by Alibaba, which allows applications to perform input and output functions through high-performance remote procedure calls (RPC). However, in the Dubbo 2.5 version, there are some restrictions on access control, especially that access can only be controlled by IP restrictions, and fine-grained control cannot be performed based on more contextual information, such as user identity, request content, etc., and with the expansion of system scale and changes in network structure, as well as the non-fixed container IP after entering the cloud, it becomes difficult and error-prone to maintain IP whitelists or exception lists. Summary of the invention

[0004] In response to at least one problem existing in the prior art, the present application provides a microservice access control method and device based on the dubbo framework, which can overcome the shortcomings of the existing access control mechanism technology and provide a method for microservice access control that is simple to implement, highly scalable and can achieve more precise.

[0005] According to the first aspect of the present application, a microservice access control method based on the dubbo framework is provided, the method comprising:

[0006] In response to receiving an access request from a service consumer, determining a target call link corresponding to the access request;

[0007] Determine the application name information and target to-be-called interface information of the service consumer according to the target call link, and determine the target service provider according to the target to-be-called interface information;

[0008] Obtaining an access authentication filter pre-configured by the target service provider, and determining whether the access request is valid based on the access authentication filter and the application name information;

[0009] In response to the access request being valid, calling the service provider interface corresponding to the target interface information to be called.

[0010] In some optional manners of this embodiment, determining a target call link corresponding to the access request includes:

[0011] Determine initial interface information to be called according to the interface configuration parameters of the access request;

[0012] Determine an initial call link according to the initial interface information to be called;

[0013] According to the online status of the initial interface information to be called, the target calling link is determined from the initial calling link.

[0014] In some optional manners of this embodiment, determining the application name information and the target to-be-called interface information of the service consumer according to the target call link includes:

[0015] Acquire additional metadata information from the target call link;

[0016] The application name information of the service consumer is determined according to the additional metadata information.

[0017] In some optional manners of this embodiment, the step of determining the additional metadata information includes:

[0018] The additional metadata information is obtained by obtaining environment variable configuration parameters or identity attribution configuration parameters through an identity authentication filter set on the service consumer side, determining the application name information of the service consumer, and adding the application name information to metadata.

[0019] In some optional manners of this embodiment, determining whether the access request is valid based on the access authentication filter and the application name information includes:

[0020] Acquire application whitelist information of the target service provider through the access authentication filter;

[0021] Matching the application whitelist information with the application name information;

[0022] In response to the application name information matching the application whitelist information, determining that the access request is valid;

[0023] In response to the application name information not matching the application whitelist information, it is determined that the access request is invalid.

[0024] In some optional manners of this embodiment, before determining the target call link corresponding to the access request, the method further includes:

[0025] The initial call link that complies with the dubbo protocol is generated through a local proxy.

[0026] In some optional manners of this embodiment, after calling the service provider interface corresponding to the target interface information to be called, the method further includes:

[0027] Monitoring the calling time of the service provider interface by a built-in filter arranged before the access authentication filter;

[0028] In response to determining that the calling time is greater than or equal to a preset time threshold, the calling of the service provider interface is interrupted.

[0029] According to the second aspect of the present application, a microservice access control device based on the dubbo framework is also provided, the device comprising:

[0030] a target call link determination module, configured to, in response to receiving an access request from a service consumer, determine a target call link corresponding to the access request;

[0031] A target service provider determination module is configured to determine the application name information and target to-be-called interface information of the service consumer according to the target call link, and determine the target service provider according to the target to-be-called interface information;

[0032] an access authentication module configured to obtain an access authentication filter pre-configured by the target service provider, and determine whether the access request is valid based on the access authentication filter and the application name information;

[0033] The calling module is configured to call the service provider interface corresponding to the interface information to be called in response to the access request being valid.

[0034] According to the third aspect of the present application, an electronic device is also provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the microservice access control method based on the dubbo framework are implemented.

[0035] According to the fourth aspect of the present application, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the microservice access control method based on the dubbo framework are implemented.

[0036] According to the fifth aspect of the present application, a computer program product is also provided, including a computer program / instruction, which, when executed by a processor, performs the steps of a microservice access control method based on the dubbo framework.

[0037] The present application provides a microservice access control method and device based on the dubbo framework. In response to receiving an access request from a service consumer, a target call link corresponding to the access request is determined; based on the target call link, the application name information and the target interface information to be called of the service consumer are determined, and the target service provider is determined based on the target interface information to be called; an access authentication filter pre-configured by the target service provider is obtained, and based on the access authentication filter and the application name information, whether the access request is valid is determined; in response to the access request being valid, the service provider interface corresponding to the target interface information to be called is called, and by adding Dubbo Filter and custom parameter configuration in a software development kit, through the flexible extension mechanism of Dubbo, a custom Filter is used to implement a whitelist or exception list access control mechanism, so as to reject all calls except for specific applications or only allow calls of specific applications, thereby improving the security of service calls and significantly improving the technical disadvantage of Dubbo 2.5 version that can only control access through IP restrictions. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative work.

[0039] Figure 1 This is one of the flowcharts of a microservice access control method based on the dubbo framework according to an embodiment of the present application;

[0040] Figure 2 This is a second flowchart of a microservice access control method based on the dubbo framework according to an embodiment of the present application;

[0041] Figure 3 This is a flowchart of a microservice access control method based on the dubbo framework according to an embodiment of the present application;

[0042] Figure 4 This is a fourth flowchart of a microservice access control method based on the dubbo framework according to an embodiment of the present application;

[0043] Figure 5This is a fifth flowchart of a microservice access control method based on the dubbo framework according to an embodiment of the present application;

[0044] Figure 6 A schematic diagram of a scenario of a microservice access control method based on the dubbo framework according to an embodiment of the present application;

[0045] Figure 7 It is a structural diagram of a microservice access control device based on the dubbo framework according to an embodiment of the present application;

[0046] Figure 8 A block diagram of an electronic device used to implement a microservice access control method based on the dubbo framework in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] An embodiment of the present application provides a microservice access control method based on the dubbo framework, such as Figure 1 As shown, the method includes:

[0049] Step 10: In response to receiving an access request from a service consumer, determining a target call link corresponding to the access request;

[0050] Step 20: Determine the application name information and target interface information to be called of the service consumer according to the target call link, and determine the target service provider according to the target interface information to be called;

[0051] Step 30: obtaining an access authentication filter pre-configured by the target service provider, and determining whether the access request is valid based on the access authentication filter and the application name information;

[0052] Step 40: In response to the access request being valid, calling the service provider interface corresponding to the target interface information to be called.

[0053] This embodiment provides a microservice access control method for the dubbo framework, which adds an access authentication filter to the software development kit and determines whether the access request is valid based on the access authentication filter, application name information and a pre-configured application whitelist, thereby significantly improving the technical shortcoming of the Dubbo 2.5 version that can only control access through IP restrictions.

[0054] Next, Figure 1 Each step is introduced:

[0055] Step 10: In response to receiving an access request from a service consumer, determine a target call link corresponding to the access request.

[0056] In this embodiment, when the service consumer sends a request, it first needs to receive the access request in the system of the service provider, which involves network transmission, protocol analysis and other steps that will not be described in detail in this application.

[0057] In the service provider's system, there needs to be a mechanism to identify the source of the access request, usually through an identifier, authentication information or other means in the access request. Once the request is received and identified, the target call link corresponding to the access request needs to be determined.

[0058] In some optional embodiments of this embodiment, Figure 2 As shown, the determining of the target call link corresponding to the access request includes:

[0059] Step 101: Determine initial interface information to be called according to the interface configuration parameters of the access request.

[0060] In this step, the interface configuration parameters of the access request are parsed, such as the URL of the interface, HTTP method (such as GET, POST, etc.), request header, and request body. Based on the parsed result, it is compared with the interface information of the service provider to determine all service provider interfaces that can meet the access request and use them as the initial interface information to be called.

[0061] Step 102: Determine an initial call link according to the initial interface information to be called.

[0062] In this step, based on determining all service provider interfaces that can satisfy the access request, a call link between the service requester and all the aforementioned service provider interfaces that satisfy the access request is established as an initial call link.

[0063] Step 103: Determine the target calling link from the initial calling link according to the online status of the initial interface information to be called.

[0064] In this step, the online status of all service provider interfaces that can satisfy the access request is further determined based on the initial interface information to be called, and the initial call link containing the offline or faulty service provider interface is removed to obtain the target call link.

[0065] Step 20: Determine the application name information and target interface information to be called of the service consumer according to the target call link, and determine the target service provider according to the target interface information to be called.

[0066] In this embodiment, after the target call link is determined, the application name information of the service consumer and the target interface information to be called are further determined. The target interface information to be called is the interface information after removing the offline or faulty service provider interface. Thus, the target service provider can be determined based on the target interface information to be called.

[0067] In some optional embodiments of this embodiment, Figure 3 As shown, determining the application name information of the service consumer is achieved in the following manner:

[0068] Step 201: Acquire additional metadata information from the target call link;

[0069] Step 202: Determine the application name information of the service consumer according to the additional metadata information.

[0070] In some optional manners of this embodiment, the step of determining the additional metadata information includes:

[0071] The additional metadata information is obtained by obtaining environment variable configuration parameters or identity attribution configuration parameters through an identity authentication filter set on the service consumer side, determining the application name information of the service consumer, and adding the application name information to metadata.

[0072] It should be noted that the metadata passed in the call link may not only be the consumer's application name, but may also include other information, such as version number, request ID, timestamp, etc. These metadata can be passed and shared between services to assist in various processing during the call process. The call link mechanism usually includes the initiation, transmission, reception and processing of call requests. In this solution, the call link plays the role of transmitting metadata, executing various interceptor logic and authentication logic, and ensuring the smooth progress of the entire call process.

[0073] In a specific example, two filters are added to the software development kit: the consumer-side authentication filter ConsumerSignFilter and the service provider-side access authentication filter ProviderAuthFilter, which work together to implement the application whitelist mechanism. Specifically:

[0074] "ConsumerSignFilter" refers to a filter used to verify the identity of consumers. In a distributed system, service providers implement some security mechanisms to ensure that only authenticated consumers can access their services. This filter verifies the identity or signature of the consumer to ensure its legitimacy and allows it to access the corresponding resources or services.

[0075] "ProviderAuthFilter" refers to the authentication filter of the service provider. In a distributed system, service providers usually implement some authentication measures to verify the identity of the caller of the service. This filter verifies the caller's identity, permissions, or other credentials to determine whether it has the right to access the requested resource or service, and authorizes or denies access accordingly.

[0076] Among them, the identity authentication filter ConsumerSignFilter on the service consumer side obtains the application name information of the service consumer by obtaining the environment variable configuration parameter _D_APP_NAME or the configured owner value (identity attribution configuration parameter), and adds the application name information setting to the metadata to obtain additional metadata information.

[0077] Furthermore, the additional metadata information is sent to the service provider through the target call link. When the service provider receives the access request, it can directly read the additional metadata information from the target call link.

[0078] On the basis that the additional metadata information includes the application name information, the application name information of the service consumer can be determined by reading the additional metadata information.

[0079] Step 30: Obtain an access authentication filter pre-configured by the target service provider, and determine whether the access request is valid based on the access authentication filter and the application name information.

[0080] In this embodiment, the access authentication filter ProviderAuthFilter on the service provider side obtains the Owner field (identity attribution field) in the additional metadata and matches it with its own application whitelist. If the match is successful, the access request is accepted; otherwise, the access request is rejected.

[0081] In some optional embodiments of this embodiment, Figure 4 As shown, the determining whether the access request is valid based on the access authentication filter and the application name information includes:

[0082] Step 301: Obtain the application whitelist information of the target service provider through the access authentication filter. In this step, the application whitelist information of the target service provider can be pre-configured, wherein the service provider can complete the configuration of the application whitelist file by configuring the application whitelist parameters and the corresponding allowed application list to set the whitelist.

[0083] It should be noted that the application whitelist information can be changed according to actual conditions. By pre-configuring application whitelist files and custom parameters corresponding to each service provider interface, the complexity of maintaining the whitelist or exception list is reduced and the maintainability of the access system is improved.

[0084] In this embodiment, the whitelist application configuration of the service provider may be saved in a configuration file or stored in a database. The provider needs to regularly update and maintain the whitelist to ensure that it can respond to changes in consumer applications in a timely manner.

[0085] Step 302: Match the application whitelist information with the application name information.

[0086] In this embodiment, the provider includes strict matching and fuzzy matching strategies when verifying the consumer application name. Strict matching requires that the consumer application name must be completely consistent with the application name in the whitelist, while fuzzy matching allows a certain degree of wildcard or regular expression matching, which is not limited in this application.

[0087] Step 303: In response to the application name information matching the application whitelist information, determining that the access request is valid;

[0088] Step 304: In response to the application name information not matching the application whitelist information, determine that the access request is invalid.

[0089] When the application name of the service consumer does not match the actual one, the access request will be rejected. The service provider obtains the application whitelist in the configuration file through the access authentication filter ProviderAuthFilter, and matches it with the application name delivered by the service consumer. If the consumer application is in the application whitelist, the access request is valid, that is, it is released and reaches the business logic side; if it is not in the application whitelist, the access request is invalid and is not released, thereby improving the security of service access.

[0090] Step 40: In response to the access request being valid, the service provider interface corresponding to the target interface information to be called can be called.

[0091] In this step, when the access request is valid, the service provider interface corresponding to the target interface information to be called is called.

[0092] In a practical application scenario, such as Figure 6 As shown in the figure, before initiating a call, the service consumer first generates a call URL that complies with the dubbo protocol through a local proxy, and then passes through the interceptor chain, which includes a custom ConsumerSignFilter interceptor (filter). This interceptor automatically obtains the consumer's application name and uses the application name as metadata attached to the call, reaching the provider side through the call link. The provider obtains the whitelist application in the configuration file through ProviderAuthFilter and matches it with the application name delivered by the consumer. If the consumer's application is in the whitelist, the access is released and reaches the business logic side.

[0093] In some optional manners of this embodiment, before determining the target call link corresponding to the access request, the method further includes:

[0094] The initial call link that complies with the dubbo protocol is generated through a local proxy.

[0095] In this embodiment, the way in which the consumer generates the calling URL involves specific rules or algorithms, such as generating a specific URL format based on the service interface name, method name, and parameter list to ensure that the generated URL meets the requirements of the dubbo protocol.

[0096] In some optional embodiments of this embodiment, Figure 5 As shown, after calling the service provider interface corresponding to the target interface information to be called, it also includes:

[0097] Step 50: Monitor the calling time of the service provider interface by setting a built-in filter before the access authentication filter;

[0098] Step 60: In response to determining that the calling time is greater than or equal to a preset time threshold, interrupting the calling of the service provider interface.

[0099] It should be noted that custom filters are executed after built-in filters by default. The default extension position can be indicated by the special value default. For example, for filter="xxx,default,yyy", xxx is before the default filter, and yyy is after the default filter. If it is set before, the call may be intercepted before the service provider monitors it, and the monitoring data is damaged.

[0100] It should be noted that the above-mentioned built-in filter is used to monitor the call time. This embodiment can also have other filters for logging, performance monitoring, exception handling and other functions. These built-in filters also need to be executed in a certain order.

[0101] The technical solution of this application adds Dubbo Filter (access authentication filter and identity authentication filter) and customized parameter configuration in the software development kit, and uses Dubbo's flexible expansion mechanism to customize Filter to implement whitelist or exception list access control mechanism, thereby rejecting all calls except for specific applications or only allowing calls from specific applications, improving the security of service calls, and significantly improving the technical disadvantage of Dubbo 2.5 version that can only control access through IP restrictions. Specific beneficial effects include:

[0102] 1. The security control capability of the open source framework is relatively simple, mainly based on the whitelist and exception list control mechanism of IP addresses to limit service access. This embodiment can provide more types of access control decisions by setting up an application whitelist mechanism.

[0103] 2. By pre-configuring the application whitelist file and customizing the whitelist parameters, the complexity of maintaining the whitelist or exception list is reduced, and the maintainability of the system is improved. Among them, the service provider can complete the configuration by configuring the whitelist parameters and the corresponding allowed application list to set the whitelist. When the consumer's application name does not match the actual one, the access will be denied.

[0104] 3. Through more refined access control rules, the risk of unauthorized access and attacks is reduced, and the security of microservice access is improved.

[0105] 4. In addition to access control such as application name, this application also allows easy addition of new access control conditions or rules to meet possible future security and access control needs, and to make more sophisticated and flexible access control decisions based on different contextual information, with excellent scalability.

[0106] At this point, the present embodiment provides a microservice access control method based on the dubbo framework, which overcomes the shortcomings of the existing access control mechanism technology and can provide a method for microservice access control that is simple to implement, highly scalable, and can achieve more precise.

[0107] It should be noted that the information collected in the technical solution of this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0108] It should be noted that the microservice access control method and device based on the dubbo framework provided in the embodiment of the present invention can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiment of the present invention does not limit the application field of the microservice access control method and device based on the dubbo framework.

[0109] Based on the same inventive concept, the embodiment of the present application also provides a microservice access control device based on the dubbo framework, which can be used to implement the method described in the above embodiment, as described in the following embodiment. Since the principle of the problem solved by the microservice access control device based on the dubbo framework is similar to that of a microservice access control method based on the dubbo framework, the implementation of a microservice access control device based on the dubbo framework can refer to the implementation of a microservice access control method based on the dubbo framework, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the system described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0110] like Figure 7 As shown, the microservice access control device based on the dubbo framework includes:

[0111] The target call link determination module 601 is configured to, in response to receiving an access request from a service consumer, determine a target call link corresponding to the access request;

[0112] The target service provider determination module 602 is configured to determine the application name information and the target to-be-called interface information of the service consumer according to the target call link, and determine the target service provider according to the target to-be-called interface information;

[0113] The access authentication module 603 is configured to obtain an access authentication filter pre-configured by the target service provider, and determine whether the access request is valid based on the access authentication filter and the application name information;

[0114] The calling module 604 is configured to call the service provider interface corresponding to the interface information to be called in response to the access request being valid.

[0115] In some optional manners of this embodiment, determining a target call link corresponding to the access request includes:

[0116] Determine initial interface information to be called according to the interface configuration parameters of the access request;

[0117] Determine an initial call link according to the initial interface information to be called;

[0118] According to the online status of the initial interface information to be called, the target calling link is determined from the initial calling link.

[0119] In some optional manners of this embodiment, determining the application name information and the target to-be-called interface information of the service consumer according to the target call link includes:

[0120] Acquire additional metadata information from the target call link;

[0121] The application name information of the service consumer is determined according to the additional metadata information.

[0122] In some optional manners of this embodiment, the step of determining the additional metadata information includes:

[0123] The additional metadata information is obtained by obtaining environment variable configuration parameters or identity attribution configuration parameters through an identity authentication filter set on the service consumer side, determining the application name information of the service consumer, and adding the application name information to metadata.

[0124] In some optional manners of this embodiment, determining whether the access request is valid based on the access authentication filter and the application name information includes:

[0125] Acquire application whitelist information of the target service provider through the access authentication filter;

[0126] Matching the application whitelist information with the application name information;

[0127] In response to the application name information matching the application whitelist information, determining that the access request is valid;

[0128] In response to the application name information not matching the application whitelist information, it is determined that the access request is invalid.

[0129] In some optional manners of this embodiment, before determining the target call link corresponding to the access request, the method further includes:

[0130] The initial call link that complies with the dubbo protocol is generated through a local proxy.

[0131] In some optional manners of this embodiment, after calling the service provider interface corresponding to the target interface information to be called, the method further includes:

[0132] Monitoring the calling time of the service provider interface by a built-in filter arranged before the access authentication filter;

[0133] In response to determining that the calling time is greater than or equal to a preset time threshold, the calling of the service provider interface is interrupted.

[0134] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0135] An electronic device comprises: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of a microservice access control method based on the dubbo framework of the aforementioned embodiment.

[0136] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the steps of a microservice access control method based on the dubbo framework of the aforementioned embodiment.

[0137] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of a microservice access control method based on the dubbo framework of the aforementioned embodiment.

[0138] Figure 8 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, 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, 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 disclosure described and / or required herein.

[0139] like Figure 8 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0140] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0141] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a microservice access control method based on the dubbo framework.

[0142] For example, in some embodiments, a microservice access control method based on the dubbo framework may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the microservice access control method based on the dubbo framework described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute a microservice access control method based on the dubbo framework in any other appropriate manner (e.g., by means of firmware).

[0143] 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.

[0144] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code 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.

[0145] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. 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.

[0146] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0147] The systems and techniques described herein may be implemented in a computing system that includes back-end 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 front-end 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 back-end components, middleware components, or front-end 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), and the Internet.

[0148] A computer 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 relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0149] 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 recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of this disclosure can be achieved, and this document is not limited here.

[0150] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. 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 disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A microservice access control method based on dubbo framework, characterized in that: include: In response to receiving an access request from a service consumer, determining a target call link corresponding to the access request; Determine the application name information and target to-be-called interface information of the service consumer according to the target call link, and determine the target service provider according to the target to-be-called interface information; Obtaining an access authentication filter pre-configured by the target service provider, and determining whether the access request is valid based on the access authentication filter and the application name information; In response to the access request being valid, calling the service provider interface corresponding to the target interface information to be called.

2. The method according to claim 1, characterized in that: Determining a target call link corresponding to the access request includes: Determine initial interface information to be called according to the interface configuration parameters of the access request; Determine an initial call link according to the initial interface information to be called; According to the online status of the initial interface information to be called, the target calling link is determined from the initial calling link.

3. The method according to claim 1, characterized in that The determining, according to the target call link, the application name information of the service consumer and the target to-be-called interface information includes: Acquire additional metadata information from the target call link; The application name information of the service consumer is determined according to the additional metadata information.

4. The method according to claim 3, characterized in that The step of determining the additional metadata information comprises: The additional metadata information is obtained by obtaining environment variable configuration parameters or identity attribution configuration parameters through an identity authentication filter set on the service consumer side, determining the application name information of the service consumer, and adding the application name information to metadata.

5. The method according to claim 1, characterized in that The determining whether the access request is valid based on the access authentication filter and the application name information includes: Acquire application whitelist information of the target service provider through the access authentication filter; Matching the application whitelist information with the application name information; In response to the application name information matching the application whitelist information, determining that the access request is valid; In response to the application name information not matching the application whitelist information, it is determined that the access request is invalid.

6. The method according to claim 2, characterized in that Before determining the target call link corresponding to the access request, the method further includes: The initial call link that complies with the dubbo protocol is generated through a local proxy.

7. The method according to claim 1, characterized in that After calling the service provider interface corresponding to the target interface information to be called, the method further includes: Monitoring the calling time of the service provider interface by a built-in filter arranged before the access authentication filter; In response to determining that the calling time is greater than or equal to a preset time threshold, the calling of the service provider interface is interrupted.

8. A microservice access control device based on dubbo framework, characterized in that: include: a target call link determination module, configured to, in response to receiving an access request from a service consumer, determine a target call link corresponding to the access request; A target service provider determination module is configured to determine the application name information and target to-be-called interface information of the service consumer according to the target call link, and determine the target service provider according to the target to-be-called interface information; an access authentication module configured to obtain an access authentication filter pre-configured by the target service provider, and determine whether the access request is valid based on the access authentication filter and the application name information; The calling module is configured to call the service provider interface corresponding to the interface information to be called in response to the access request being valid.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of a microservice access control method based on the dubbo framework as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a microservice access control method based on the dubbo framework described in any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of a microservice access control method based on the dubbo framework as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Interface authentication method and device based on dubbo frame and computer readable storage medium

    CN108418814A

  • Interface permission control method and device based on dubbo framework

    CN112217823A

  • Micro-service request response method and device, equipment and storage medium

    CN113419852A

  • Interface unvarnished transmission method, combined transaction unvarnished transmission system and readable storage medium

    CN117560436A

  • Association of Service Policies Based on the Application of Message Content Filters

    US20130340026A1

Cited By

  • Linux operating system DBus service security management and control method, device and product

    CN118862050A