Implementation method for authentication verification current limiting of foundation base

By registering and automatically configuring the microservice gateway, the code duplication and management difficulties of interface parameter checks and authentication in the microservice architecture are solved, and automated permission checks and current limit interception is realized, which improves the security and stability of the system. , simplifies management and maintenance.

CN118944906APending Publication Date: 2024-11-12BEIYIN FINANCIAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410792265.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In microservice architecture, the existing technology has code duplication, management difficulties, high coupling, security problems and inefficiency, especially in the verification and authentication of interface parameters, resulting in complex system maintenance and increased security risks.

Method used

By registering a microservice gateway, applying for or authorizing access to other gateways, and automatically configuring relevant parameters, gateway permission verification and current limit interception are realized, and a unified management end is used for automatic configuration and synchronization, ensuring that only requests with permissions are passed. And intercept overthreshold requests according to the current limiting rules.

Benefits of technology

Implement automated permission check-up and current limit interception between microservices, reduce manual configuration and maintenance costs, improve system security and stability, simplify management and maintenance processes, and reduce code redundancy and error possibilities. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944906A_ABST
    Figure CN118944906A_ABST
Patent Text Reader

Abstract

The invention provides a method for realizing authentication, verification and current limiting of a foundation base. The method comprises the following steps of: S1, registering a microservice gateway; s2, applying or authorizing an access application to other gateways, and automatically configuring related parameters; and S3, automatically executing the gateway permission verification. Automatic discovery and registration of the service are realized, and the development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of microservice architecture, and in particular to a method for implementing basic base authentication verification and current limiting. Background Art

[0002] In the application scenario of microservice architecture, the function positioning of the gateway is particularly critical. It is not only the only outlet for a group of microservices to provide services to the outside world, but also undertakes a series of non-business-related processing tasks. These processing tasks include service calls, message conversion, current limiting and fusing, authentication, etc., which are all general functions unrelated to specific business logic.

[0003] By placing these processing tasks on the gateway side, centralized management and unified control of services can be effectively achieved. In this way, each microservice can focus on processing specific business logic without having to worry about the implementation details of these common functions.

[0004] 2.1 Microservice module self-processing solution

[0005] This method usually adopts the basic gateway method for development. The basic idea of ​​this method is that the gateway itself will not be modified or customized, but various interface parameter verification, authentication and other functions are directly placed in each microservice module for development.

[0006] One of the main advantages of this is that since all functions are concentrated in one service, development and function debugging can be carried out conveniently. This centralized development method allows developers to focus more on the implementation of functions without spending too much energy on dealing with various complex problems in distributed systems.

[0007] This approach also has some obvious disadvantages. First, since each microservice needs to implement similar non-business logic code, such as interface parameter verification and authentication, this leads to repeated code writing and increases the workload of development. Second, this similar code across microservices makes code management and maintenance more difficult. Once these non-business logic codes need to be modified or updated, they may need to be modified in multiple microservices, which undoubtedly increases the complexity of maintenance.

[0008] Although the basic gateway approach can simplify the development and debugging process, it is not friendly from the perspective of design pattern because of the problems of code duplication and difficult management.

[0009] 2.2 Gateway unified processing solution

[0010] The core strategy of this solution is to uniformly develop and maintain standard customized gateway projects in the system to implement gateway tasks such as service forwarding, current limiting and fusing, message conversion, data verification, etc. This strategy is one of the most widely used strategies at present, which can achieve unified development and adaptation of non-business logic, thereby reducing duplication of work.

[0011] By adopting this strategy, we can develop and maintain on a unified code base, ensuring that the functions and behaviors of each gateway are consistent. This helps improve development efficiency and reduce code redundancy and the possibility of errors. At the same time, because all gateways share the same processing code, we can better control and manage their behavior.

[0012] This strategy also has some disadvantages. Although we provide a unified processing code, each gateway needs to be configured on its own, including authentication keys, etc. This means that we need to configure and manage each gateway separately, which increases the workload. In addition, due to the lack of management for specific service groups, we may not be able to fully utilize the functions and performance of the gateway.

[0013] The core strategy of this solution is to realize the basic functions of the gateway and reduce duplication of work by uniformly developing and maintaining standard customized gateway projects.

[0014] Disadvantages of Microservice Module Self-Processing Solution

[0015] The main disadvantages of this solution are as follows:

[0016] 1. Code duplication: Each microservice needs to implement the same non-business logic code, such as interface parameter verification, authentication, etc., which will lead to code duplication and increase maintenance costs.

[0017] 2. Inconvenient to manage: Since non-business logic codes are scattered in various microservices, it is not convenient to manage and update them in a unified manner.

[0018] 3. High coupling: Although this approach reduces the complexity of a single service, the overall coupling is increased because each service needs to handle similar non-business logic.

[0019] 4. Security issues: If there are vulnerabilities in non-business logic code, all microservices may be affected, increasing the security risk of the system.

[0020] 5. Inefficiency: Each microservice needs to perform the same operations, such as authentication, which consumes more resources and reduces the efficiency of the system.

[0021] 2. Disadvantages of gateway unified processing solution

[0022] The main disadvantages of this solution are as follows:

[0023] 1. Complex configuration: Although non-business logic codes can be developed and adapted in a unified manner, related gateway configurations need to be performed on their respective gateways, which increases the complexity of configuration.

[0024] 2. Inconvenient management: Since each microservice needs to be configured in its own gateway, including authentication keys, etc., it makes the management of the entire system inconvenient.

[0025] 3. Security issues: If the gateway configuration information is leaked, it may pose a threat to the security of the system.

[0026] 4. Lack of flexibility: Since all microservices use the same gateway project, if special processing or optimization is required for a specific microservice, it may be restricted. Summary of the invention

[0027] In view of the above problems, the present invention is proposed to provide a method for implementing basic base authentication verification and current limiting that overcomes the above problems or at least partially solves the above problems.

[0028] According to one aspect of the present invention, a method for implementing basic base authentication verification and current limiting is provided, and the implementation method includes:

[0029] Step S1: Register the microservice gateway;

[0030] Step S2: Apply for or authorize access to other gateways and automatically configure related parameters;

[0031] Step S3: Gateway authority verification is automatically performed.

[0032] Optionally, the step S1: registering the microservice gateway gateway specifically includes:

[0033] The user logs in to the microservice gateway control console. After successful login, the user will enter the microservice creation interface;

[0034] On the creation interface, the user needs to enter information to register a new microservice;

[0035] After entering all the necessary information, the user submits the information to complete the registration of the microservice;

[0036] The registration is successful and the microservice gateway generates a unique ID for the newly created microservice.

[0037] Optionally, the input information specifically includes: the name of the microservice, port number, system description, and other parameters or configuration information.

[0038] Optionally, the microservice gateway control console also provides a one-click download function to directly download the running source code package containing all the input parameter information;

[0039] Users do not need to manually configure any parameters to deploy and run microservices.

[0040] Optionally, the step S2: applying for or authorizing access to other gateways and automatically configuring related parameters specifically includes:

[0041] The user submits an access request to the person in charge of the target microservice gateway;

[0042] If approved, the system will automatically generate a key, which is the unique identifier of the gateway application;

[0043] The system also allows you to set the requested access volume for the application gateway;

[0044] By setting access limits, administrators can ensure stable operation of the system while also better managing costs;

[0045] Administrators also have the ability to manage permissions for their own gateway forwarding services.

[0046] Optionally, the access request includes: specific information that the user wishes to access and the purpose of use.

[0047] Optionally, the step S3: automatic execution of gateway authority verification specifically includes:

[0048] Based on the operation, the ID, key and authorization-related interface information of the service accessing the gateway and the called gateway are synchronized to the Nacos service registration center through automatic configuration;

[0049] When each gateway receives a request, it will verify it according to the key and interface authorization list pre-configured by the control console to ensure that only requests with corresponding permissions can pass;

[0050] When the request reaches each gateway, the gateway verifies it according to the key and interface authorization list configured by the control console;

[0051] After completing the service permission verification, the gateway will limit the flow of requests;

[0052] The gateway intercepts requests that exceed the threshold according to the preset current limiting rules to ensure the stable operation of the system.

[0053] Optionally, the gateway performs verification according to the key and interface authorization list configured by the control console, specifically including:

[0054] The gateway checks whether the key in the request matches the key configured in the control console. If the keys match, the gateway will continue to check whether the interface accessed by the request is in the interface authorization list. When both conditions are met, the request is allowed to pass.

[0055] The present invention provides a method for implementing authentication verification and current limiting of a basic base, the method comprising: step S1: registering a microservice gateway; step S2: applying for or authorizing access to other gateways, and automatically configuring relevant parameters; step S3: automatically executing gateway authority verification. Automatic discovery and registration of services are achieved, improving development efficiency.

[0056] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0058] Figure 1 A schematic diagram of registering a microservice gateway, applying for and automatically configuring authorization, and automatically executing gateway permission verification provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0060] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.

[0061] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0062] The present invention specifically includes the following steps according to the way in which the user uses the gateway:

[0063] The first step is to register the microservice gateway;

[0064] The second step is to apply for or authorize access to other gateways and automatically configure related parameters;

[0065] In the third step, the gateway permission check is automatically executed.

[0066] like Figure 1 As shown, register the microservice gateway gateway, including:

[0067] The user needs to log in to the microservice gateway control console. Enter a valid username and password to verify the user's identity. After successful login, the user will enter the microservice creation interface.

[0068] On the creation interface, users need to enter information to register a new microservice.

[0069] The input information includes: microservice name, port number, system description, and other parameters or configuration information.

[0070] After entering all the necessary information, the user submits the information to complete the microservice registration. Once the registration is successful, the microservice gateway generates a unique ID for the newly created microservice. The ID is the unique identifier of the microservice and is used to identify and manage the microservice throughout the system.

[0071] The microservice gateway control console also provides a one-click download function. Through this function, users can directly download the running source code package containing all the input parameter information. This means that users can quickly deploy and run this microservice without manually configuring any parameters.

[0072] like Figure 1 As shown, apply for and authorize automatic configuration:

[0073] The user submits an access request to the person in charge of the target microservice gateway. The request contains the specific information that the user wants to access and their purpose of use. Once the application is submitted, the person in charge of the target microservice gateway will be responsible for reviewing the request. Evaluate the applicant's needs and whether the applicant's gateway meets security standards and compliance requirements.

[0074] The approval process is an important step to ensure that only authorized users can access sensitive resources. If approved, the system will automatically generate a key, which is the unique identifier of the gateway application and is used for subsequent access verification. The generated key will be securely sent to the applicant to start using the target microservice gateway.

[0075] In addition to generating keys, the system also allows you to set the number of requests for gateway applications. This helps administrators control and limit the use of resources to prevent them from being over-consumed or abused. By setting limits on access, administrators can ensure the stable operation of the system while also better managing costs.

[0076] Administrators also have the ability to manage permissions for their own gateway forwarding services. Decide which external requests are forwarded through their gateway. This feature provides additional security because administrators can ensure that only trusted services are allowed to call their gateway.

[0077] like Figure 1 As shown, the gateway permission check is automatically performed:

[0078] Based on the above operations, the ID, key and authorization-related interface information of the access gateway and the called gateway are synchronized to the Nacos service registration center through automatic configuration. When each gateway receives a request, it will be verified according to the key and interface authorization list pre-configured by the control console to ensure that only requests with corresponding permissions can pass.

[0079] When the request reaches each gateway, the gateway will verify it according to the key and interface authorization list configured by the control console. During this process, the gateway first checks whether the key in the request matches the key configured by the control console. If the keys match, the gateway will continue to check whether the interface accessed by the request is in the interface authorization list. Only when both conditions are met will the request be allowed to pass.

[0080] After completing the service permission verification, the gateway will also limit the flow of requests to prevent malicious requests or sudden traffic from causing excessive pressure on the system. The gateway will intercept requests that exceed the threshold according to the preset flow limiting rules to ensure the stable operation of the system.

[0081] Through the above steps, service permission verification and related flow control interception between microservices are realized, thereby ensuring the security and stability of the system. At the same time, since the entire process is completed automatically, the cost of manual configuration and maintenance is reduced, and the scalability and maintainability of the system are improved.

[0082] The present invention adopts an advanced unified gateway processing method to provide users with a convenient micro-service gateway management terminal. In this management terminal, users can easily register and manage their own gateway service groups. Each gateway has a unique number, which is registered on the secondary management terminal and belongs to the current user for management.

[0083] When other microservices need to call different gateway services, they need to apply to the target gateway on the management side. Once authorized, the system will generate an encryption key for configuration management. In this way, only authorized microservices can access specific gateway services, ensuring security and reliability.

[0084] The present invention also combines the nacos component of microservices so that the corresponding gateway configuration can be completed automatically. This means that once the user has made the corresponding configuration on the management side, the relevant gateway services will be automatically updated and synchronized without manual intervention. This automated configuration management method greatly improves efficiency and reduces the possibility of human error.

[0085] Through the combination of the unified gateway processing method of the present invention and the microservice gateway management terminal, users can easily manage and configure their own gateway service groups, ensuring security and efficiency. Whether it is registration, attribution management or configuration management, it can be easily completed on the management terminal, bringing great convenience to users.

[0086] Beneficial effects:

[0087] 1. Automatic configuration: Based on the above operations, the ID, key, and authorization-related interfaces of the services that access the gateway and the called gateway can be automatically configured to the nacos service. Once a new service needs to be connected, you only need to make corresponding configurations on the control console to achieve automatic discovery and registration of the service, which improves development efficiency.

[0088] 2. Easy to maintain: All configurations are centralized in the control console, making the maintenance of the entire system easier. When you need to modify or update the configuration, you only need to operate on the control console, without having to configure each service separately.

[0089] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for implementing basic base authentication verification and current limiting, characterized in that: The implementation method includes: Step S1: Register the microservice gateway; Step S2: Apply for or authorize access to other gateways and automatically configure related parameters; Step S3: Gateway authority verification is automatically performed.

2. A method for implementing basic base authentication verification and current limiting according to claim 1, characterized in that: The step S1: registering the microservice gateway specifically includes: The user logs in to the microservice gateway control console. After successful login, the user will enter the microservice creation interface; On the creation interface, the user needs to enter information to register a new microservice; After entering all the necessary information, the user submits the information to complete the registration of the microservice; The registration is successful and the microservice gateway generates a unique ID for the newly created microservice.

3. A method for implementing basic base authentication verification and current limiting according to claim 2, characterized in that: The input information specifically includes: the name of the microservice, port number, system description, and other parameters or configuration information.

4. A method for implementing basic base authentication verification and current limiting according to claim 2, characterized in that: The microservice gateway control console also provides a one-click download function to directly download the running source code package containing all the input parameter information; Users do not need to manually configure any parameters to deploy and run microservices.

5. A method for implementing basic base authentication verification and current limiting according to claim 1, characterized in that: The step S2: applying for or authorizing access to other gateways and automatically configuring related parameters specifically includes: The user submits an access request to the person in charge of the target microservice gateway; If approved, the system will automatically generate a key, which is the unique identifier of the gateway application; The system also allows you to set the requested access volume for the application gateway; By setting access limits, administrators can ensure stable operation of the system while also better managing costs; Administrators also have the ability to manage permissions for their own gateway forwarding services.

6. A method for implementing basic base authentication verification and current limiting according to claim 5, characterized in that: The access request includes: the specific information the user wishes to access and the purpose of use.

7. A method for implementing basic base authentication verification and current limiting according to claim 1, characterized in that: The step S3: automatic execution of gateway authority verification specifically includes: Based on the above operations, the ID, key and authorization-related interface information of the access gateway and the called gateway services are synchronized to the Nacos service registration center through automatic configuration; When each gateway receives a request, it will verify it according to the key and interface authorization list pre-configured by the control console to ensure that only requests with corresponding permissions can pass; When the request reaches each gateway, the gateway verifies it according to the key and interface authorization list configured by the control console; After completing the service permission verification, the gateway will limit the flow of requests; The gateway intercepts requests that exceed the threshold according to the preset current limiting rules to ensure the stable operation of the system.

8. A method for implementing basic base authentication verification and current limiting according to claim 1, characterized in that: The gateway verifies the key and interface authorization list configured by the control console, including: The gateway checks whether the key in the request matches the key configured in the control console. If the keys match, the gateway will continue to check whether the interface accessed by the request is in the interface authorization list. When both conditions are met, the request is allowed to pass.