A method for implementing application system API authentication in a componentized manner
Developing API authentication components based on tenant information in a componentized manner solves the resource consumption and security issues of API gateway deployment in multi-tenant mode, and achieves the unification and security of API authentication.
Patent Information
- Application Number
- CN202410362306.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-03-28
AI Technical Summary
In multi-tenant mode, the deployment of existing API gateways requires additional resource consumption and increased operation and maintenance costs, and there are repetitive construction and security issues, making it difficult to achieve unified API authentication.
Using a componentized approach, API authentication components are developed based on tenant information, authenticated through tenant key front-end and back-end logic, combined with artificial intelligence models for hierarchical encapsulation, uploaded to designated servers, and introduced and initialized in the application system. Determine the legality of the calling action through interceptor configuration and matching.
It avoids the deployment of additional gateways, reduces resource waste and operation and maintenance costs, realizes the unification of API authentication among multi-tenants, reduces learning and cognitive costs, and ensures the security of API calls.
Smart Images

Figure CN118233182B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of API gateways, and in particular to a method for implementing application system API authentication in a componentized manner. Background Art
[0002] API Gateway is an architectural pattern that has emerged along with microservices. It is used to solve the problem that microservices are too decentralized and there is no unified entrance and exit for traffic management. API Gateway can abstract the common functions required by various business systems at the upper layer, such as authentication, current limiting, ACL, downgrade, etc.
[0003] In the multi-tenant mode of the application system, when unified authentication is performed at the API, gateway integration requires additional deployment of gateways, which consumes certain resources and increases operation and maintenance costs. It is not suitable for scenarios where a single deployment is required. In addition, since each application system has its own coding logic to implement API authentication, there may be duplication of construction, resulting in time-consuming and labor-intensive situations, and there are also security issues in the API authentication process. Summary of the invention
[0004] The present invention provides a method for implementing application system API authentication in a componentized manner, so as to solve the problems raised in the background technology.
[0005] A method for implementing application system API authentication in a componentized manner, comprising:
[0006] S1: Based on the tenant information, develop the tenant information code, obtain the information code, design the API authentication component based on the information code, and upload the API authentication component to the designated server;
[0007] S2: The application system introduces and initializes the API authentication component to obtain an applicable API authentication component;
[0008] S3: Runs the program in multi-tenant mode and obtains the calling actions during the running of the program;
[0009] S4: Based on the applicable API authentication component, a legal judgment is made on the calling action to determine whether the calling action is legal.
[0010] Preferably, in S1, based on the tenant information, tenant information code development is performed to obtain the information code, including:
[0011] Divide the tenant information according to the data attribute characteristics corresponding to the business logic analysis rules to obtain multiple tenant characteristic information, input the tenant characteristic information into the business logic analysis layer, and obtain the tenant key front-end logic, tenant key back-end logic and tenant authentication logic;
[0012] Based on the tenant key front-end logic, tenant key back-end logic and tenant authentication logic, combined with the code development platform, the tenant key front-end code, tenant key back-end code and tenant authentication logic code are obtained;
[0013] The tenant key front-end code, the tenant key back-end code and the tenant authentication logic code are code-verified to obtain the information code.
[0014] Preferably, in S1, obtaining an API authentication component based on the information code design, and uploading the API authentication component to a designated server, includes:
[0015] Based on the API authentication function module, the information code is split to obtain multiple function module codes. Based on the core features of the API authentication function module, the core code is selected from the corresponding function module codes.
[0016] Obtain component configuration parameter information based on the core code, perform hierarchical encapsulation of the model components based on the artificial intelligence model to obtain a component encapsulation template, input the component configuration parameter information into the component encapsulation template, and obtain an API authentication component;
[0017] Based on the IP address of the specified server, upload the API authentication component to the specified server.
[0018] Preferably, in S2, the application system introduces and initializes the API authentication component to obtain an applicable API authentication component, including:
[0019] Building an import project based on the API authentication component, building an import instruction based on the import project, parsing the API authentication component based on the import instruction, and obtaining component import information;
[0020] Introduce the API authentication component according to the component introduction information, and obtain the API authentication component in the application system;
[0021] Based on the API authentication component, the database script is initialized, the multi-tenant information is maintained, the API authentication component is initialized, and the applicable API authentication component is obtained.
[0022] Preferably, in the S3, running the running program in the multi-tenant mode and obtaining the calling action during the running of the running program include:
[0023] Before the running program in the multi-tenant mode is run, the identification information of each tenant is configured for the interceptor in the multi-tenant mode, and the corresponding interception task group is configured for each tenant in the interceptor based on the identification information;
[0024] Based on the priority characteristics and interception identification characteristics of each tenant, feature configuration is performed for each interception task group to obtain an executable interception task group;
[0025] Parse the running program in the multi-tenant mode to obtain the program execution characteristics, match the program execution characteristics with the executable interception task group to obtain the corresponding matching relationship, and configure the interception task for each feasible interception task group based on the matching relationship;
[0026] After completing the task configuration of the feasible interception task group, run the running program in the tenant mode. The feasible interception task group in the interceptor monitors and captures the execution results of the running program to obtain the execution results that need to be intercepted.
[0027] Based on the interception function in the feasible interception task group, the execution action of the execution result that needs to be intercepted is obtained, and the execution action is parsed based on the interception function to obtain the action feature, and the action feature is matched with the standard action feature corresponding to the interception function. If the match is successful, the execution result is intercepted and the execution action is used as a calling action. Otherwise, it is determined that the execution result does not need to be intercepted.
[0028] Preferably, matching the program execution feature with the executable interception task group to obtain a corresponding matching relationship includes:
[0029] Determine the task characteristics in the executable interception task group, standardize the program execution characteristics and task characteristics, and obtain the standard program execution characteristics and standard task characteristics in a unified format;
[0030] Key feature matching is performed on standard program execution features and standard task features, and the corresponding matching relationship between program execution features and executable interception task groups is obtained based on the key feature matching connection.
[0031] Preferably, in S4, the calling action is judged to be legal based on the applicable API authentication component to determine whether the calling action is legal, including:
[0032] Determine a requester and a receiver of the call action, and obtain, from applicable API authentication components, applicable API authentication components related to the requester and the receiver as target API authentication components;
[0033] Based on the target API authentication component, the tenant information of the requester is used to make a legal judgment on the calling action.
[0034] Preferably, the determining the requester and the receiver of the call action, and obtaining the applicable API authentication component related to the requester and the receiver from the applicable API authentication components as the target API authentication component, includes:
[0035] Acquire the tenant's agreed characters from the call action, acquire the tenant identity information corresponding to the agreed characters based on the tenant database, and determine the tenant's requester or receiver identity based on specific characters in the agreed characters;
[0036] The tenant identity information corresponding to the agreed characters is compared with the tenant identity information of the applicable API authentication component, the applicable API authentication component corresponding to the requester and the receiver of the call action is determined, and the applicable API authentication component is used as the target API authentication component.
[0037] Preferably, the target API authentication component uses the tenant information of the requester to make a legal judgment on the calling action, including:
[0038] Obtain the authentication parameters of the requester from the target API authentication component, and generate a request signature based on the authentication parameters of the requester;
[0039] Generate an API authentication request based on the tenant signature, and obtain the recipient's authentication parameters from the target API authentication component;
[0040] Get the tenant code and call timestamp from the call action;
[0041] Based on the tenant code and the recipient's authentication parameters, obtain the key configuration parameters;
[0042] Based on the key configuration parameters, the request signature is decoded to obtain the request code and request timestamp carried in the requester;
[0043] Compare the request code with the tenant code to obtain the code comparison result, and compare the request timestamp with the call timestamp to obtain the timestamp comparison result;
[0044] When both the encoding comparison result and the timestamp comparison result are successfully compared, the calling action is determined to be legal and the calling action is released; otherwise, the calling action is determined to be illegal and the calling action remains blocked.
[0045] Preferably, the acquiring of key configuration parameters based on the tenant code and in combination with the authentication parameters of the receiver includes:
[0046] Determine the key decoding parameters based on the receiver's authentication parameters, and determine the key encoding parameters based on the tenant code;
[0047] Get key configuration parameters based on key encoding parameters and key decoding parameters.
[0048] Compared with the prior art, the present invention has achieved the following beneficial effects:
[0049] By developing tenant information code based on tenant information, obtaining information code, and obtaining API authentication component based on information code design, and uploading API authentication component to the designated server, the application system introduces and initializes the API authentication component to obtain applicable API authentication component. By integrating components, it is possible to avoid deploying additional gateways in the business system, increasing deployment and operation and maintenance costs, and causing waste of resources. It achieves the unification of API authentication specifications among various systems in multi-tenant mode, reduces the learning and cognitive costs of system API calls, runs the program based on the multi-tenant mode, and obtains the calling actions during the running of the program. Based on the applicable API authentication component, the calling action is legally judged to determine whether the calling action is legal, thereby ensuring the security of system API calls.
[0050] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures specifically pointed out in this application document.
[0051] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0053] Figure 1 A flowchart of a method for implementing application system API authentication in a componentized manner in an embodiment of the present invention;
[0054] Figure 2 A flowchart of obtaining an information code in an embodiment of the present invention;
[0055] Figure 3 The flowchart of obtaining the applicable API authentication component in the embodiment of the present invention. DETAILED DESCRIPTION
[0056] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0057] Embodiment 1:
[0058] The embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner, such as Figure 1 As shown, including:
[0059] S1: Based on the tenant information, develop the tenant information code, obtain the information code, design the API authentication component based on the information code, and upload the API authentication component to the designated server;
[0060] S2: The application system introduces and initializes the API authentication component to obtain an applicable API authentication component;
[0061] S3: Runs the program in multi-tenant mode and obtains the calling actions during the running of the program;
[0062] S4: Based on the applicable API authentication component, a legal judgment is made on the calling action to determine whether the calling action is legal.
[0063] In this embodiment, tenant information code development includes tenant and key maintenance back-end code, authentication logic back-end code, tenant and key maintenance front-end code, etc.
[0064] In this embodiment, the designated server is a private server, that is, the address of the storage component built by oneself.
[0065] In this embodiment, tenant information code development is performed based on the springboot technology stack.
[0066] In this embodiment, if it is determined that the calling action is legal, it is determined that the corresponding tenant API authentication has passed, otherwise, it is determined that the corresponding tenant API authentication has failed.
[0067] In this embodiment, the running program in the multi-tenant mode is a running program that implements business interaction among multiple tenants.
[0068] The beneficial effects of the above design scheme are: by developing tenant information code based on tenant information, obtaining information code, and obtaining API authentication component based on information code design, and uploading API authentication component to the designated server, the application system introduces and initializes the API authentication component to obtain applicable API authentication component, and through component integration, it is possible to avoid deploying additional gateways for business systems, increase deployment and operation and maintenance costs, and cause waste of resources, thereby achieving the unification of API authentication specifications among various systems in a multi-tenant mode, reducing the learning and cognitive costs of system API calls, and running programs based on a multi-tenant mode, and obtaining calling actions during the running of the running programs, and making a legal judgment on the calling actions based on the applicable API authentication components to determine whether the calling actions are legal, thereby ensuring the security of system API calls.
[0069] Embodiment 2:
[0070] Based on Example 1, the present invention provides a method for implementing application system API authentication in a componentized manner, such as Figure 2 As shown, in S1, based on the tenant information, the tenant information code is developed to obtain the information code, including:
[0071] Divide the tenant information according to the data attribute characteristics corresponding to the business logic analysis rules to obtain multiple tenant characteristic information, input the tenant characteristic information into the business logic analysis layer, and obtain the tenant key front-end logic, tenant key back-end logic and tenant authentication logic;
[0072] Based on the tenant key front-end logic, tenant key back-end logic and tenant authentication logic, combined with the code development platform, the tenant key front-end code, tenant key back-end code and tenant authentication logic code are obtained;
[0073] The tenant key front-end code, the tenant key back-end code and the tenant authentication logic code are code-verified to obtain the information code.
[0074] The beneficial effect of the above design scheme is: by developing tenant information code based on tenant information, the information code is obtained, which provides a basis for building an API authentication component.
[0075] Embodiment 3:
[0076] Based on Example 1, the embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner. In S1, an API authentication component is obtained based on the information code design, and the API authentication component is uploaded to a designated server, including:
[0077] Based on the API authentication function module, the information code is split to obtain multiple function module codes. Based on the core features of the API authentication function module, the core code is selected from the corresponding function module codes.
[0078] Obtain component configuration parameter information based on the core code, perform hierarchical encapsulation of the model components based on the artificial intelligence model to obtain a component encapsulation template, input the component configuration parameter information into the component encapsulation template, and obtain an API authentication component;
[0079] Based on the IP address of the specified server, upload the API authentication component to the specified server.
[0080] The beneficial effects of the above design scheme are: by obtaining an API authentication component based on information code design, and uploading the API authentication component to a designated server, by means of component integration, it is possible to avoid deploying additional gateways in the business system, increase deployment and operation and maintenance costs, and cause waste of resources, thereby achieving the unification of API authentication specifications between systems in a multi-tenant mode.
[0081] Embodiment 4:
[0082] Based on Example 1, the present invention provides a method for implementing application system API authentication in a componentized manner, such as Figure 3 As shown, in S2, the application system introduces and initializes the API authentication component to obtain an applicable API authentication component, including:
[0083] Building an import project based on the API authentication component, building an import instruction based on the import project, parsing the API authentication component based on the import instruction, and obtaining component import information;
[0084] Introduce the API authentication component according to the component introduction information, and obtain the API authentication component in the application system;
[0085] Based on the API authentication component, the database script is initialized, the multi-tenant information is maintained, the API authentication component is initialized, and the applicable API authentication component is obtained.
[0086] The beneficial effect of the above design scheme is: the API authentication component is introduced and initialized through the application system, an applicable API authentication component is obtained, and the smooth operation and use of the API authentication component in the application system is achieved.
[0087] Embodiment 5:
[0088] Based on Example 1, the embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner. In S3, the running program is run based on the multi-tenant mode, and the calling action during the running of the running program is obtained, including:
[0089] Before the running program in the multi-tenant mode is run, the identification information of each tenant is configured for the interceptor in the multi-tenant mode, and the corresponding interception task group is configured for each tenant in the interceptor based on the identification information;
[0090] Based on the priority characteristics and interception identification characteristics of each tenant, feature configuration is performed for each interception task group to obtain an executable interception task group;
[0091] Parse the running program in the multi-tenant mode to obtain the program execution characteristics, match the program execution characteristics with the executable interception task group to obtain the corresponding matching relationship, and configure the interception task for each feasible interception task group based on the matching relationship;
[0092] After completing the task configuration of the feasible interception task group, run the running program in the tenant mode. The feasible interception task group in the interceptor monitors and captures the execution results of the running program to obtain the execution results that need to be intercepted.
[0093] Based on the interception function in the feasible interception task group, the execution action of the execution result that needs to be intercepted is obtained, and the execution action is parsed based on the interception function to obtain the action feature, and the action feature is matched with the standard action feature corresponding to the interception function. If the match is successful, the execution result is intercepted and the execution action is used as a calling action. Otherwise, it is determined that the execution result does not need to be intercepted.
[0094] The beneficial effects of the above design scheme are: before the running program in the multi-tenant mode is run, the identification information of each tenant is configured for the interceptor in the multi-tenant mode, and the corresponding interception task group is configured for each tenant in the interceptor based on the identification information. Based on the priority characteristics and interception identification characteristics of each tenant, feature configuration is performed for each interception task group to obtain an executable interception task group, and the setting of the interceptor is implemented. After completing the task configuration of the feasible interception task group, the running program in the tenant mode is run, and the feasible interception task group in the interceptor monitors and captures the execution result of the running program to obtain the execution result that needs to be intercepted; based on the interception function in the feasible interception task group, the execution action is obtained for the execution result that needs to be intercepted, and the execution action is parsed based on the interception function to obtain the action feature, and the action feature is matched with the standard action feature corresponding to the interception function. If the match is successful, the execution result is intercepted and the execution action is used as a call action. Otherwise, it is determined that the execution result does not need to be intercepted, and the execution result is intercepted and analyzed, the accuracy of the interception is ensured, and the accuracy of the obtained call action is ensured, providing a basis for API authentication.
[0095] Embodiment 6:
[0096] Based on Example 5, the embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner, wherein the program execution features are matched with the executable interception task group to obtain a corresponding matching relationship, including:
[0097] Determine the task characteristics in the executable interception task group, standardize the program execution characteristics and task characteristics, and obtain the standard program execution characteristics and standard task characteristics in a unified format;
[0098] Key feature matching is performed on standard program execution features and standard task features, and the corresponding matching relationship between program execution features and executable interception task groups is obtained based on the key feature matching connection.
[0099] The beneficial effects of the above design scheme are: by determining the task characteristics in the executable interception task group, the program execution characteristics and task characteristics are standardized to obtain standard program execution characteristics and standard task characteristics in a unified format, providing a standard data basis for the matching between program execution characteristics and the executable interception task group, and then performing key feature matching on the standard program execution characteristics and the standard task characteristics, and according to the key feature matching connection, obtaining the corresponding matching relationship between the program execution characteristics and the executable interception task group, ensuring the accuracy of the obtained matching relationship, and providing a basis for further call action interception.
[0100] Embodiment 7:
[0101] Based on Example 1, the embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner. In S4, the calling action is legally judged based on the applicable API authentication component to determine whether the calling action is legal, including:
[0102] Determine a requester and a receiver of the call action, and obtain, from applicable API authentication components, applicable API authentication components related to the requester and the receiver as target API authentication components;
[0103] Based on the target API authentication component, the tenant information of the requester is used to make a legal judgment on the calling action.
[0104] The beneficial effects of the above design scheme are: by determining the requester and receiver of the call action, the applicable API authentication components related to the requester and receiver are obtained from the applicable API authentication components as the target API authentication components; based on the target API authentication component, the tenant information of the requester is used to make a legal judgment on the call action, thereby ensuring the security of the system API call.
[0105] Embodiment 8:
[0106] Based on Example 7, an embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner, wherein determining the requester and the receiver of the call action, and obtaining the applicable API authentication component related to the requester and the receiver from the applicable API authentication component as the target API authentication component, includes:
[0107] Acquire the tenant's agreed characters from the call action, acquire the tenant identity information corresponding to the agreed characters based on the tenant database, and determine the tenant's requester or receiver identity based on specific characters in the agreed characters;
[0108] The tenant identity information corresponding to the agreed characters is compared with the tenant identity information of the applicable API authentication component, the applicable API authentication component corresponding to the requester and the receiver of the call action is determined, and the applicable API authentication component is used as the target API authentication component.
[0109] In this embodiment, the tenant database records the correspondence between the agreed characters and the tenants.
[0110] In this embodiment, the specific characters are used to identify the tenant as a requester or a receiver, the specific characters of the requester are fixed, the specific characters of the receiver are fixed, and the specific characters of the requester or the receiver are different.
[0111] The beneficial effect of the above design scheme is: by obtaining the tenant's agreed characters in the calling action, obtaining the tenant identity information corresponding to the agreed characters based on the tenant database, and determining the tenant's requester or receiver identity based on specific characters in the agreed characters, ensuring the accuracy of determining the requester and receiver of the calling action, and further realizing the accurate selection of the target API authentication component, providing a component basis for API authentication.
[0112] Embodiment 9:
[0113] Based on Example 7, the embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner, wherein the target API authentication component uses the tenant information of the requester to make a legal judgment on the calling action, including:
[0114] Obtain the authentication parameters of the requester from the target API authentication component, and generate a request signature based on the authentication parameters of the requester;
[0115] Generate an API authentication request based on the tenant signature, and obtain the recipient's authentication parameters from the target API authentication component;
[0116] Get the tenant code and call timestamp from the call action;
[0117] Based on the tenant code and the recipient's authentication parameters, obtain the key configuration parameters;
[0118] Based on the key configuration parameters, the request signature is decoded to obtain the request code and request timestamp carried in the requester;
[0119] Compare the request code with the tenant code to obtain the code comparison result, and compare the request timestamp with the call timestamp to obtain the timestamp comparison result;
[0120] When both the encoding comparison result and the timestamp comparison result are successfully compared, the calling action is determined to be legal and the calling action is released; otherwise, the calling action is determined to be illegal and the calling action remains blocked.
[0121] The beneficial effects of the above design scheme are: by obtaining the authentication parameters of the requester from the target API authentication component, generating a request signature based on the authentication parameters of the requester, obtaining the information of the requester, calling the action to obtain the tenant code, calling the timestamp, obtaining the information of the calling action, comparing the request code with the tenant code to obtain the code comparison result, comparing the request timestamp with the calling timestamp to obtain the timestamp comparison result; when the code comparison result and the timestamp comparison result are both successfully compared, it is determined that the calling action is legal and the calling action is released, otherwise, it is determined that the mobilization action is illegal, and the calling action is kept in an intercepted state, and the legality of the mobilization action is judged based on the target API authentication component, thereby ensuring the security of the system API call.
[0122] Embodiment 10:
[0123] Based on Example 9, the embodiment of the present invention provides a method for implementing application system API authentication in a componentized manner, wherein the method obtains key configuration parameters based on the tenant code and in combination with the authentication parameters of the receiver, including:
[0124] Determine the key decoding parameters based on the receiver's authentication parameters, and determine the key encoding parameters based on the tenant code;
[0125] Get key configuration parameters based on key encoding parameters and key decoding parameters.
[0126] The beneficial effects of the above design scheme are: by determining the key decoding parameters based on the authentication parameters of the receiver, and determining the key encoding parameters based on the tenant code; based on the key encoding parameters and key decoding parameters, the key configuration parameters are obtained to implement API authentication, providing a configuration parameter basis for API authentication, and realizing the unification of API authentication specifications between various systems in the multi-tenant mode, reducing the learning and cognitive costs of system API calls.
[0127] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention belong to the scope of this application document and its equivalent technology, the present invention is also intended to include these changes and variations.
Claims
1. A method for implementing application system API authentication in a componentized manner, characterized in that: include: S1: Based on the tenant information, develop the tenant information code, obtain the information code, design the API authentication component based on the information code, and upload the API authentication component to the designated server; S2: The application system introduces and initializes the API authentication component to obtain an applicable API authentication component; S3: Runs the program in multi-tenant mode and obtains the calling actions during the running of the program; S4: Based on the applicable API authentication component, the call action is judged to determine whether the call action is legal; In S1, based on the tenant information, the tenant information code is developed to obtain the information code, including: Divide the tenant information according to the data attribute characteristics corresponding to the business logic analysis rules to obtain multiple tenant characteristic information, input the tenant characteristic information into the business logic analysis layer, and obtain the tenant key front-end logic, tenant key back-end logic and tenant authentication logic; Based on the tenant key front-end logic, tenant key back-end logic and tenant authentication logic, combined with the code development platform, the tenant key front-end code, tenant key back-end code and tenant authentication logic code are obtained; Perform code verification on the tenant key front-end code, the tenant key back-end code and the tenant authentication logic code to obtain an information code; In S1, an API authentication component is obtained based on the information code design, and the API authentication component is uploaded to a designated server, including: Based on the API authentication function module, the information code is split to obtain multiple function module codes. Based on the core features of the API authentication function module, the core code is selected from the corresponding function module codes. Obtain component configuration parameter information based on the core code, perform hierarchical encapsulation of the model components based on the artificial intelligence model to obtain a component encapsulation template, input the component configuration parameter information into the component encapsulation template, and obtain an API authentication component; Upload the API authentication component to the specified server based on the IP address of the specified server.
2. According to the method of implementing application system API authentication in a componentized manner in claim 1, it is characterized in that: In S2, the application system introduces and initializes the API authentication component to obtain an applicable API authentication component, including: Building an import project based on the API authentication component, building an import instruction based on the import project, parsing the API authentication component based on the import instruction, and obtaining component import information; Introduce the API authentication component according to the component introduction information, and obtain the API authentication component in the application system; Based on the API authentication component, the database script is initialized, the multi-tenant information is maintained, the API authentication component is initialized, and the applicable API authentication component is obtained.
3. According to the method of implementing application system API authentication in a componentized manner in claim 1, it is characterized in that: In the S3, the running program is run based on the multi-tenant mode, and the calling actions during the running of the running program are obtained, including: Before the running program in the multi-tenant mode is run, the identification information of each tenant is configured for the interceptor in the multi-tenant mode, and the corresponding interception task group is configured for each tenant in the interceptor based on the identification information; Based on the priority characteristics and interception identification characteristics of each tenant, feature configuration is performed for each interception task group to obtain an executable interception task group; Parse the running program in the multi-tenant mode to obtain the program execution characteristics, match the program execution characteristics with the executable interception task group to obtain the corresponding matching relationship, and configure the interception task for each feasible interception task group based on the matching relationship; After completing the task configuration of the feasible interception task group, run the running program in the tenant mode. The feasible interception task group in the interceptor monitors and captures the execution results of the running program to obtain the execution results that need to be intercepted. Based on the interception function in the feasible interception task group, the execution action of the execution result that needs to be intercepted is obtained, and the execution action is parsed based on the interception function to obtain the action feature, and the action feature is matched with the standard action feature corresponding to the interception function. If the match is successful, the execution result is intercepted and the execution action is used as a calling action. Otherwise, it is determined that the execution result does not need to be intercepted.
4. The method for implementing application system API authentication in a componentized manner according to claim 3, characterized in that: The matching of the program execution features with the executable interception task group to obtain a corresponding matching relationship includes: Determine the task characteristics in the executable interception task group, standardize the program execution characteristics and task characteristics, and obtain the standard program execution characteristics and standard task characteristics in a unified format; Key feature matching is performed on standard program execution features and standard task features, and the corresponding matching relationship between program execution features and executable interception task groups is obtained based on the key feature matching connection.
5. The method for implementing application system API authentication in a componentized manner according to claim 1, characterized in that: In S4, the calling action is judged to be legal based on the applicable API authentication component to determine whether the calling action is legal, including: Determine a requester and a receiver of the call action, and obtain, from applicable API authentication components, applicable API authentication components related to the requester and the receiver as target API authentication components; Based on the target API authentication component, the tenant information of the requester is used to make a legal judgment on the calling action.
6. The method for implementing application system API authentication in a componentized manner according to claim 5, characterized in that: The determining of the requester and the receiver of the call action, and obtaining the applicable API authentication component related to the requester and the receiver from the applicable API authentication component as the target API authentication component, includes: Acquire the tenant's agreed characters from the call action, acquire the tenant identity information corresponding to the agreed characters based on the tenant database, and determine the tenant's requester or receiver identity based on specific characters in the agreed characters; The tenant identity information corresponding to the agreed characters is compared with the tenant identity information of the applicable API authentication component, the applicable API authentication component corresponding to the requester and the receiver of the call action is determined, and the applicable API authentication component is used as the target API authentication component.
7. The method for implementing application system API authentication in a componentized manner according to claim 5, characterized in that: The target API authentication component uses the tenant information of the requester to make a legal judgment on the calling action, including: Obtain the authentication parameters of the requester from the target API authentication component, and generate a request signature based on the authentication parameters of the requester; Generate an API authentication request based on the tenant signature, and obtain the recipient's authentication parameters from the target API authentication component; Get the tenant code and call timestamp from the call action; Based on the tenant code and the recipient's authentication parameters, obtain the key configuration parameters; Based on the key configuration parameters, the request signature is decoded to obtain the request code and request timestamp carried in the requester; Compare the request code with the tenant code to obtain the code comparison result, and compare the request timestamp with the call timestamp to obtain the timestamp comparison result; When both the encoding comparison result and the timestamp comparison result are successfully compared, the calling action is determined to be legal and the calling action is released; otherwise, the calling action is determined to be illegal and the calling action remains blocked.
8. The method for implementing application system API authentication in a componentized manner according to claim 7, characterized in that: The method of obtaining key configuration parameters based on the tenant code and the authentication parameters of the receiver includes: Determine the key decoding parameters based on the receiver's authentication parameters, and determine the key encoding parameters based on the tenant code; Get key configuration parameters based on key encoding parameters and key decoding parameters.
