A method and device for controlling code operation authority

By receiving operation permission allocation requests from the Web application server, and updating the permission configuration file according to the version library information, the automatic allocation of code operation permissions is realized, and the cumbersome permission management problem in the existing technology is solved, and efficiency and security are improved.

CN112883344BActive Publication Date: 2024-12-06INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110147052.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-03
Publication Date
2024-12-06
Estimated Expiration
2041-02-03

AI Technical Summary

Technical Problem

The existing code management platform has limited permission management functions and relies on human communication and manual allocation, resulting in cumbersome and high cost of operation permission allocation.

Method used

Provide a control method and device for code operation permissions. By receiving operation permission allocation requests from the Web application server, obtaining permission configuration files based on version library information, writing user information and permission information, and making the configuration files take effect, realizing automated permission allocation .

Benefits of technology

It improves the efficiency of code operation permission allocation, supports automated permission management, reduces communication costs and manual operation errors, and enhances code security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112883344B_ABST
    Figure CN112883344B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for controlling code operation permissions, which can be used in the financial field or other technical fields. The method comprises: receiving an operation permission allocation request sent by a Web application server, the operation permission allocation request comprising user information, version library information and permission information; obtaining a permission configuration file of the corresponding version library according to the version library information, and writing the user information and permission information into the permission configuration file of the version library corresponding to the version library information and making the permission configuration file of the version library corresponding to the version library information effective; returning the permission allocation result to the Web application server. The device is used to execute the above method. The method and device for controlling code operation permissions provided by the embodiments of the present invention improve the efficiency of allocating code operation permissions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for controlling code operation permissions. Background Art

[0002] As the scale of software expands, more and more people will be involved in the development of software products. While ensuring R&D efficiency, it is necessary to manage the security of software product codes.

[0003] The code of software products can be stored in the code management platform in the form of a version library. Project-related personnel need to have the operation permissions of the version library to obtain the code and perform related operations. At present, mainstream code management platforms have supporting permission management functions, but this function is very limited. For example, Gerrit only categorizes various operations of the version library. The management of permissions depends entirely on human communication and manual allocation. The steps are very cumbersome and time-consuming. Summary of the invention

[0004] In view of the problems in the prior art, an embodiment of the present invention provides a method and device for controlling code operation permissions, which can at least partially solve the problems in the prior art.

[0005] On the one hand, the present invention provides a method for controlling code operation permissions, comprising:

[0006] Receive an operation authority allocation request sent by a Web application server, wherein the operation authority allocation request includes user information, version library information, and authority information;

[0007] Obtaining a rights configuration file of the corresponding version library according to the version library information, and writing the user information and the rights configuration file into the rights configuration file of the version library corresponding to the version library information and making the rights configuration file of the version library corresponding to the version library information effective;

[0008] Return the permission allocation result to the Web application server.

[0009] In another aspect, the present invention provides a device for controlling code operation permissions, comprising:

[0010] A first receiving unit is used to receive an operation authority allocation request sent by a Web application server, wherein the operation authority allocation request includes user information, version library information and authority information;

[0011] A writing unit, used for obtaining a rights configuration file of a corresponding version library according to the version library information, and writing the user information and the rights configuration file into the rights configuration file of the version library corresponding to the version library information and making the rights configuration file of the version library corresponding to the version library information effective;

[0012] The returning unit is used to return the permission allocation result to the Web application server.

[0013] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for controlling code operation permissions described in any of the above embodiments when executing the program.

[0014] In yet another aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for controlling code operation permissions described in any of the above embodiments.

[0015] The code operation permission control method and device provided by the embodiment of the present invention can receive an operation permission allocation request sent by a Web application server, obtain a permission configuration file of a corresponding version library according to version library information, write user information and permission information into the permission configuration file of the version library corresponding to the version library information, make the permission configuration file of the version library corresponding to the version library information effective, return the permission allocation result to the Web application server, realize the automatic allocation of version library operation permissions, and improve the allocation efficiency of code operation permissions. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0017] Figure 1 It is a flowchart of a method for controlling code operation permissions provided by the first embodiment of the present invention.

[0018] Figure 2 It is a flowchart of a method for controlling code operation permissions provided by a second embodiment of the present invention.

[0019] Figure 3 It is a flowchart of a method for controlling code operation permissions provided by the third embodiment of the present invention.

[0020] Figure 4 It is a structural diagram of a control system for code operation permissions provided by a fourth embodiment of the present invention.

[0021] Figure 5 It is a flowchart of a method for controlling code operation permissions provided by a fifth embodiment of the present invention.

[0022] Figure 6 It is a flowchart of permission clearing provided by the sixth embodiment of the present invention.

[0023] Figure 7 It is a schematic diagram of the structure of a device for controlling code operation permissions provided by the seventh embodiment of the present invention.

[0024] Figure 8 It is a schematic diagram of the structure of a device for controlling code operation permissions provided by an eighth embodiment of the present invention.

[0025] Fig. 9 It is a schematic diagram of the structure of a device for controlling code operation permissions provided by a ninth embodiment of the present invention.

[0026] Fig.10 It is a schematic diagram of the structure of a device for controlling code operation permissions provided by the tenth embodiment of the present invention.

[0027] Fig.11 It is a schematic diagram of the physical structure of an electronic device provided in the eleventh embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.

[0029] Figure 1 FIG. 1 is a flow chart of a method for controlling code operation permissions provided by an embodiment of the present invention. Figure 1 As shown, the method for controlling code operation permissions provided by an embodiment of the present invention includes:

[0030] S101, receiving an operation authority allocation request sent by a Web application server, wherein the operation authority allocation request includes user information, version library information, and authority information;

[0031] Specifically, the Web application server may send an operation permission allocation request to the code management platform, and the operation permission allocation request includes user information, version library information and permission information. The user information may include a user identifier, the version library information may include at least one version library identifier, and the permission information may include information such as permission role, permission type, permission period, and permission expiration date. The operation permission allocation request may be sent after the user information, version library information and permission information are approved. The code management platform will receive the operation permission allocation request. The code management platform may be a single server or a server cluster, which is set according to actual needs and is not limited in the embodiments of the present invention.

[0032] Among them, users correspond to user identifiers one-to-one, and version library identifiers correspond to version libraries one-to-one. The permission roles include but are not limited to developers, code reviewers, read-only personnel, etc., which are set according to actual needs and are not limited in the embodiment of the present invention. The permission types include but are not limited to read-only permissions, submission permissions, merge permissions, etc., which are set according to actual needs and are not limited in the embodiment of the present invention. There is a corresponding relationship between rights roles and permission types. For example, developers can configure read-only permissions and submission permissions, and code reviewers can configure read-only permissions, submission permissions, merge permissions, etc., which are set according to actual needs and are not limited in the embodiment of the present invention. The permission period refers to the period of the permission type possessed by the permission role, which is set according to actual needs and is not limited in the embodiment of the present invention. The executor of the code operation permission control method provided in the embodiment of the present invention includes but is not limited to the code management platform.

[0033] For example, a user may send a permission application request to a Web application server through a first terminal, and the Web application server may push the permission application request to a second terminal for approval by a reviewer corresponding to the second terminal. After receiving the approval information for the permission application request, the Web application server may send an operation permission allocation request to the code management platform. The permission application request may include user information, version library information, and permission information. The first terminal and the second terminal include, but are not limited to, desktop computers, laptop computers, tablet computers, smart phones, etc.

[0034] S102, obtaining a rights configuration file of the corresponding version library according to the version library information, and writing the user information and the rights information into the rights configuration file of the version library and making the rights configuration file effective;

[0035] Specifically, after receiving the operation permission allocation request, the code management platform can obtain the permission configuration file of the version library corresponding to the version library information according to the version library information query. The version library information includes at least one version library identifier, so the code management platform will obtain the permission configuration file of at least one version library. After obtaining the permission configuration file of the version library corresponding to the version library information, the code management platform will write the user information and permission information into the permission configuration file of the version library corresponding to the version library information. If the version library information includes a version library identifier, the code management platform will write the user information and permission information into the permission configuration file of the version library corresponding to the above version library identifier; if the version library information includes multiple version library identifiers, the code management platform will write the user information and permission information into the permission configuration file of the version library corresponding to each version library identifier in the above multiple version library identifiers. After modifying the permission configuration file of the version library corresponding to the version library information, the code management platform will make the permission configuration file of the version library corresponding to the version library information effective.

[0036] For example, the code management platform can use a code management tool to make the permission configuration file of the version library corresponding to the version library information effective. The code management tool, such as Git, is selected according to actual needs and is not limited in the embodiment of the present invention.

[0037] S103: Return the permission allocation result to the Web application server.

[0038] Specifically, after the permission configuration file of the version library corresponding to the version library information takes effect, the code management platform will return the permission allocation result to the Web application server. The permission allocation result may include a prompt message of successful permission allocation, and may also carry the user information, the version library information and the permission information, which is set according to actual needs and is not limited in the embodiment of the present invention. It is understandable that if the permission configuration file of the version library corresponding to the version library information fails to take effect or the permission configuration file cannot be queried, then the code management platform may return a prompt message of failed permission allocation to the Web application server.

[0039] The method for controlling code operation permissions provided by the embodiment of the present invention can receive an operation permission allocation request sent by a Web application server, obtain a permission configuration file of a corresponding version library according to version library information, write user information and permission information into the permission configuration file of the version library corresponding to the version library information, make the permission configuration file of the version library corresponding to the version library information effective, return the permission allocation result to the Web application server, realize the automatic allocation of version library operation permissions, and improve the allocation efficiency of code operation permissions.

[0040] Figure 2 FIG. 1 is a flow chart of a method for controlling code operation permissions provided by a second embodiment of the present invention. Figure 2 As shown, based on the above embodiments, further, the method for controlling code operation permissions provided by the embodiment of the present invention also includes:

[0041] S201, receiving a user authority period query request sent regularly by a proxy server, and returning user operation authority information to the proxy server;

[0042] Specifically, the proxy server will periodically send user permission deadline query requests to the code management platform. The code management platform will receive the user permission deadline query request, and then query the permission configuration files of each version library to obtain the permission information of each user, and the permission information includes the permission expiration date. The code management platform returns the user operation permission information to the proxy server, and the user operation permission information may include the user ID of each user, the version library ID corresponding to each user ID, and the permission information corresponding to the version library ID. Among them, the permission information may also include permission type and permission role, which are set according to actual needs, and are not limited in the embodiment of the present invention. The timing is set according to actual needs, such as 1 a.m. every day, and is not limited in the embodiment of the present invention.

[0043] For example, user A has read-only permission to version library B, and the permission expires on date x. User C has read-only permission and submit permission to version library D. The read-only permission expires on date y, and the submit permission expires on date z. The user operation permission information returned by the code management platform to the proxy server will include user A's user ID, version library ID of version library B, read-only permission and permission expiration date x, user C's user ID, version library ID of version library D, read-only permission and corresponding permission expiration date y, submit permission and corresponding permission expiration date z. Since user A has only one operation permission to version library B, the sent user operation permission information may not include user A's permission type to version library B: read-only permission, so as to reduce the amount of data transmitted.

[0044] S202: Receive a first user rights clearing request sent by the proxy server, where the first user rights clearing request includes rights clearing information; wherein the first user rights clearing request is sent by the proxy server after learning that there is a user whose rights have expired based on the user operation rights information;

[0045] Specifically, after receiving the user operation permission information, the proxy server can calculate whether the user's permission has expired based on the current time and the permission expiration date included in the permission information corresponding to each version library of the user. If the user's permission has expired, the user identifier is obtained, and the version library identifier of the version library where the user's permission has expired is used as the cleanup information of the customer whose permission has expired. If the user has multiple permissions in the version library, the cleanup information of the customer whose permission has expired can also include the expired permission type. After obtaining the cleanup information of all users whose permissions have expired based on the user operation permission information, the proxy server will send a first user permission cleanup request to the code management platform. The first user permission cleanup request includes permission cleanup information, and the permission cleanup information includes cleanup information of each customer whose permission has expired. The code management platform will receive the first user permission cleanup request.

[0046] For example, after receiving the user operation permission information including the user ID of user A, the version library ID of version library B, the read-only permission and the permission expiration date x, the user ID of user C, the version library ID of version library D, the read-only permission and the corresponding permission expiration date y, the submit permission and the corresponding permission expiration date z, the proxy server can determine whether the read-only permission of user A to version library B has expired according to the current date and the permission expiration date x, determine whether the read-only permission of user C to version library D has expired according to the current date and the permission expiration date y, and determine whether the submit permission of user C to version library D has expired according to the current date and the permission expiration date z. If the proxy server determines that the read-only permission of user A to version library B has expired, the cleanup information of user A includes the user ID of user A, the version library ID of version library B and the read-only permission. Since user A has only one operation permission to version library B, the read-only permission can be omitted in the cleanup information of user A. If the proxy server determines that user C's read-only permission to version library D has not expired, but user C's commit permission to version library D has expired, then the cleanup information of user C includes user C's user ID, version library ID of version library D, and commit permission.

[0047] S203: Deleting relevant information of users whose permissions have expired in the permission configuration file of the corresponding version library according to the permission cleanup information.

[0048] Specifically, after receiving the first user permission cleanup request sent by the proxy server, the code management platform obtains permission cleanup information from the first user permission cleanup request, and then searches for the permission configuration file of the version library corresponding to the version library identifier included in the cleanup information according to each piece of cleanup information included in the permission cleanup information, and then deletes the relevant information of the user whose permission has expired included in the cleanup information from the permission configuration file of the corresponding version library. After the code management platform completes processing each piece of cleanup information included in the permission cleanup information, the cleanup of the operation permission of the user whose permission has expired is completed. Among them, the relevant information of the user whose permission has expired may include user identification, permission type, permission period, etc., which are set according to actual needs and are not limited in the embodiment of the present invention.

[0049] For example, the permission cleanup information obtained by the code management platform from the first user permission cleanup request includes two pieces of cleanup information, the cleanup information of user A includes the user ID of user A and the version library ID of version library B, and the cleanup information of user C includes the user ID of user C, the version library ID of version library D, and the submission permission. The code management platform will query and obtain the permission configuration file of version library B according to the version library ID of version library B included in the cleanup information of user A, and then delete the user ID of user A, the read-only permission of user A, and the permission information corresponding to the read-only permission of user A from the permission configuration file of version library B. The code management platform will query and obtain the permission configuration file of version library D according to the version library ID of version library D included in the cleanup information of user C, and then delete the submission permission of user C and the permission information corresponding to the submission permission of user C from the permission configuration file of version library D. Since user C also has read-only permission in version library D, the user ID of user C will not be deleted from the permission configuration file of version library D.

[0050] Figure 3 FIG. 1 is a flow chart of a method for controlling code operation permissions provided by a third embodiment of the present invention. Figure 3 As shown, based on the above embodiments, further, the method for controlling code operation permissions provided by the embodiment of the present invention also includes:

[0051] S301, receiving a second user rights cleaning request sent by a proxy server, where the second user rights cleaning request includes user cleaning information; wherein the second user rights cleaning request is sent by the proxy server after the proxy server learns that the user has resigned from the company through query;

[0052] Specifically, the proxy server may query and obtain user status information from the user information management server, and the user status information includes whether the user is employed or has resigned. After the proxy server learns that the user has resigned through query, it may send a second user rights cleanup request to the code management platform, and the second user rights cleanup request includes user cleanup information, and the user cleanup information may include the user ID of the resigned user. The code management platform will receive the second user rights cleanup request.

[0053] S302: Delete relevant information of the resigned user from the authority configuration files of all version repositories according to the user cleanup information.

[0054] Specifically, after receiving the second user permission cleanup request, the code management platform can obtain user cleanup information from the second user permission cleanup request, and can delete the relevant information of the resigned user from the permission configuration file of each version library according to the user identifier included in the user cleanup information. The relevant information of the resigned user is the permission role, permission type, permission period and other information corresponding to the user identifier of the resigned user stored in the permission configuration file.

[0055] For example, the code management platform obtains the user ID of the former user E from the user cleanup information, and then queries the permission configuration file of each version library for relevant information corresponding to the user ID of user E based on the user ID of user E. If relevant information corresponding to the user ID of user E is found, the relevant information corresponding to the user ID of user E is deleted. If no relevant information corresponding to the user ID of user E is found, no deletion operation is required.

[0056] On the basis of the above embodiments, further, the method for controlling code operation permissions provided by the embodiment of the present invention also includes:

[0057] Send the permission cleanup result to the Web application server.

[0058] Specifically, after the code management platform completes the cleaning of the operation rights of the user whose rights have expired according to the rights cleaning information, it can send a rights cleaning result to the Web application server, and the rights cleaning result can include prompt information of the user whose rights have expired and the rights cleaning information.

[0059] After the code management platform completes the cleaning of the operation permissions of the resigned user according to the user cleaning information, the code management platform may send a permission cleaning result to the Web application server. The permission cleaning result may include prompt information of the resigned user and the user identifier of the resigned user.

[0060] Figure 4: is a schematic diagram of the structure of a control system for code operation permissions provided by a fourth embodiment of the present invention. Figure 4 As shown, the control system for code operation permissions provided by the embodiment of the present invention includes a code management platform 1, a Web application server 2, a proxy server 3 and a user information management server 4, wherein:

[0061] The code management platform 1 is respectively connected to the Web application server 2 , the proxy server 3 and the user information management server 4 , the Web application server 2 is respectively connected to the proxy server 3 and the user information management server 4 , and the proxy server 3 is connected to the user information management server 4 .

[0062] The code management platform 1 can encapsulate various types of operation permissions of the version library into service interfaces, such as read-only permission, submission permission, merge permission, etc. The code management platform 1 receives the operation permission allocation request sent by the Web application server 2, and the operation permission allocation request includes user information, version library information and permission information. The code management platform 1 obtains the permission configuration file of the corresponding version library according to the version library information, and writes the user information and permission information into the permission configuration file of the version library corresponding to the version library information and makes the permission configuration file of the version library corresponding to the version library information effective, so as to grant the user relevant operation permissions on the version library. The code management platform 1 will return the permission allocation result to the Web application server 2.

[0063] Web application server 2 is installed with Web application, and various permission roles can be customized according to work needs. Web application server 2 saves all version libraries and user information. Users can log in to Web application server 2 through the first terminal, select the version library and permission role for which permission needs to be applied, and send permission application request to Web application server 2. The reviewer can log in to Web application server 2 through the second terminal to approve the above permission application request. After approval, Web application server 2 will send an operation permission allocation request to code management platform 1.

[0064] The proxy server 3 can send a user permission period query request to the code management platform 1 at regular intervals every day to check whether the user's operating permission for the version library has expired. After determining that the user's operating permission has expired, the proxy server 3 sends a first user permission cleanup request to the code management platform 1 to delete the relevant information of the user whose permission has expired, thereby cleaning up the operating permission of the user whose permission has expired. The proxy server 3 can send a user status query request to the user information management server 4 to inquire whether the user has resigned. After learning that the user has resigned, the proxy server 3 sends a second user permission cleanup request to the code management platform 1 to delete the relevant information of the resigned user, thereby cleaning up the operating permission of the resigned user.

[0065] The user information management server 4 records all basic user information, including user name, user ID, password, user status, etc. The code management platform 1, the Web application server 2 and the proxy server 3 can communicate with the user information management server 4 through the Ldap protocol, and the user logs in to the code management platform 1 and the Web application server 2 with a unified user name and password.

[0066] Figure 5 is a schematic diagram of a permission application process provided by the fifth embodiment of the present invention. Figure 5 As shown, the process of the method for controlling code operation permissions provided by the embodiment of the present invention is as follows:

[0067] The first step is to receive a permission application request. The user sends a permission application request to the Web application server through the first terminal, and the Web application server receives the permission application request. The permission application request may include user information, version library information, and permission information.

[0068] Step 2: Send a permission approval request. The Web application server sends a permission approval request to the second terminal so that the approver can approve the permission. The approver views the permission approval request through the second terminal, decides whether to approve or reject the request, and then returns the permission approval result to the Web application server through the second terminal. The permission approval result is either approved or rejected. The permission approval request may include user information, repository information, and permission information.

[0069] Step 3: Receive the permission approval result: The Web application server receives the permission approval result sent by the second terminal.

[0070] Step 4: Determine whether the approval is passed. The Web application server can obtain the approval or failure information from the permission approval result. If the approval is passed, then go to step 5. If the approval is failed, then go to step 9.

[0071] Step 5: Send an operation permission allocation request. The Web application server sends an operation permission allocation request to the code management platform. The operation permission allocation request includes user information, version library information, and permission information.

[0072] Step 6: Assign operation permissions. The code management platform obtains the permission configuration file of the corresponding version library based on the version library information, and then writes the user information and permission information into the permission configuration file of the version library and makes the permission configuration file effective.

[0073] Step 7: Return the result of the operation permission allocation. After the permission configuration file takes effect, the code management platform returns the result of the operation permission allocation to the Web application server. The permission allocation result includes a prompt message indicating that the permission allocation is successful, and can also carry user information, version library information, and permission information.

[0074] Step 8: Storing the operation authority allocation result: The Web application server receives the operation authority allocation result and stores it locally.

[0075] Step 9: Send the allocation result information. The Web application server sends the allocation result information to the first terminal. If the approval fails, the allocation result information carries prompt information of allocation failure. If the Web application server receives the operation permission allocation result, the allocation result information carries prompt information of allocation success.

[0076] Figure 6 : is a flowchart of permission clearing provided by the sixth embodiment of the present invention, such as Figure 6 As shown, the process of clearing permissions provided by the embodiment of the present invention is as follows:

[0077] The first step is to send a user permission deadline query request. The proxy server can send a user permission deadline query request to the code management platform at regular intervals every day. The code management platform will receive the user permission deadline query request, and then query the permission configuration file of each repository to obtain the permission information of each user, including the permission expiration date. The code management platform returns the user operation permission information to the proxy server. The user operation permission information may include the user ID of each user, the repository ID corresponding to each user ID, and the permission information corresponding to the repository ID.

[0078] Step 2: Determine whether there is an expired user. After receiving the user's operation permission information, the proxy server can calculate whether the user's permission has expired based on the current time and the permission expiration date included in the permission information corresponding to each version library of the user. If it has expired, then proceed to step 3; if it has not expired, then proceed to step 5.

[0079] Step 3: Send a first user rights cleanup request: The proxy server sends a first user rights cleanup request to the code management platform, and the first user rights cleanup request includes rights cleanup information.

[0080] Step 4: Clean up the operation permissions of expired users. The code management platform deletes the relevant information of users with expired permissions in the permission configuration file of the corresponding version library based on the permission cleanup information to clean up the operation permissions of expired users.

[0081] Step 5: Send a user status query request. The proxy server sends a user status query request to the user information management server, and the user information management server returns user status information to the proxy server. The user status information includes whether the user is employed or has resigned.

[0082] Step 6: Determine whether there are any resigned users. After obtaining the user status information, if there is any user status information indicating that the user has resigned, then obtain all user status information indicating that the user has resigned and proceed to step 7; if all user status information indicates that the user is in service, it means that there are no resigned users and the operation is terminated.

[0083] Step 7: Send a second user rights cleanup request. The proxy server can send a second user rights cleanup request to the code management platform to clean up the operation rights of the resigned user. The second user rights cleanup request includes user cleanup information.

[0084] Step 8: Clean up the resigned users. After receiving the second user's permission cleanup request, the code management platform deletes the relevant information of the resigned user from the permission configuration files of all version repositories according to the user cleanup information, and completes the cleanup of the operation permissions of the resigned user.

[0085] Step 9: Send permission cleanup results. After the code management platform has cleaned up the expired user's operation permissions, it will send permission cleanup results with prompt information of expired users and permission cleanup information to the Web application server. After the code management platform has cleaned up the operation permissions of resigned users, it will send permission cleanup results with prompt information of resigned users and user IDs of resigned users to the Web application server.

[0086] Among them, after the code management platform completes the cleaning of the operation permissions of expired users and / or the cleaning of the operation permissions of resigned users, it can also send the permission cleaning results to the proxy server, and the proxy server can notify the relevant users of the permission cleaning results.

[0087] The method for controlling code operation permissions provided by the embodiment of the present invention has the following advantages:

[0088] (1) It can support the authority management of various code management platforms, which is flexible and efficient;

[0089] (2) The entire process of permission management is automatically completed through the interface application, avoiding security issues caused by manual operation errors and greatly reducing communication costs;

[0090] (3) Supports customized repository permission roles, which solves the problem of fixed permission roles in the code permission management process and achieves the purpose of controlling code security;

[0091] (4) Support the permission exit mechanism to clean up expired operation permissions and the operation permissions of resigned personnel, so as to avoid the risk of code leakage caused by the continued use of code by personnel after their expiration.

[0092] Figure 7 is a schematic diagram of the structure of a control device for code operation permissions provided by a seventh embodiment of the present invention. Figure 7 As shown, the control device for code operation permissions provided by the embodiment of the present invention includes a first receiving unit 701, a writing unit 702 and a returning unit 703, wherein:

[0093] The first receiving unit 701 is used to receive an operation permission allocation request sent by a Web application server, wherein the operation permission allocation request includes user information, version library information and permission information; the writing unit 702 is used to obtain a permission configuration file of a corresponding version library according to the version library information, and write the user information and permission information into the permission configuration file of the version library corresponding to the version library information and make the permission configuration file of the version library corresponding to the version library information effective; the returning unit 703 is used to return a permission allocation result to the Web application server.

[0094] Specifically, the Web application server may send an operation permission allocation request to the first receiving unit 701, and the operation permission allocation request includes user information, version library information, and permission information. The user information may include a user identifier, the version library information may include at least one version library identifier, and the permission information may include information such as permission role, permission type, permission period, and permission expiration date. The operation permission allocation request may be sent after the user information, version library information, and permission information are approved. The first receiving unit 701 will receive the operation permission allocation request.

[0095] After receiving the operation permission allocation request, the writing unit 702 can obtain the permission configuration file of the version library corresponding to the version library information according to the version library information query. The version library information includes at least one version library identifier, so the writing unit 702 will obtain the permission configuration file of at least one version library. After obtaining the permission configuration file of the version library corresponding to the version library information, the writing unit 702 will write the user information and permission information into the permission configuration file of the version library corresponding to the version library information. If the version library information includes a version library identifier, the writing unit 702 will write the user information and permission information into the permission configuration file of the version library corresponding to the version library identifier; if the version library information includes multiple version library identifiers, the writing unit 702 will write the user information and permission information into the permission configuration file of the version library corresponding to each version library identifier in the multiple version library identifiers. After modifying the permission configuration file of the version library corresponding to the version library information, the writing unit 702 will make the permission configuration file of the version library corresponding to the version library information effective.

[0096] After the permission configuration file of the version library corresponding to the version library information takes effect, the return unit 703 will return the permission allocation result to the Web application server. The permission allocation result may include a prompt message of successful permission allocation, and may also carry the user information, the version library information and the permission information, which is set according to actual needs and is not limited in the embodiment of the present invention. It is understandable that if the permission configuration file of the version library corresponding to the version library information fails to take effect or the permission configuration file cannot be queried, the return unit 703 may return a prompt message of failed permission allocation to the Web application server.

[0097] The control device for code operation permissions provided by the embodiment of the present invention can receive an operation permission allocation request sent by a Web application server, obtain a permission configuration file of a corresponding version library according to version library information, write user information and permission information into the permission configuration file of the version library corresponding to the version library information, make the permission configuration file of the version library corresponding to the version library information effective, and return the permission allocation result to the Web application server, thereby realizing automatic allocation of version library operation permissions and improving the allocation efficiency of code operation permissions.

[0098] Figure 8 is a schematic diagram of the structure of a control device for code operation permissions provided by an eighth embodiment of the present invention. Figure 8 As shown, on the basis of the above embodiments, further, the control device of the code operation authority provided by the embodiment of the present invention further includes a second receiving unit 704, a third receiving unit 705 and a first deleting unit 706, wherein:

[0099] The second receiving unit 704 is used to receive a user authority period query request sent by the proxy server at a regular interval, and return user operation authority information to the proxy server; the third receiving unit 705 is used to receive a first user authority cleanup request sent by the proxy server, and the first user authority cleanup request includes authority cleanup information; wherein, the first user authority cleanup request is sent by the proxy server after learning that there is a user whose authority has expired based on the user operation authority information; the first deleting unit 706 is used to delete the relevant information of the user whose authority has expired in the authority configuration file of the corresponding version library according to the authority cleanup information.

[0100] Specifically, the proxy server will periodically send a user authority deadline query request to the second receiving unit 704. The second receiving unit 704 will receive the user authority deadline query request, and then query the authority information of each user in the authority configuration file of each version library, and the authority information includes the authority expiration date. The second receiving unit 704 returns the user operation authority information to the proxy server, and the user operation authority information may include the user ID of each user, the version library ID corresponding to each user ID, and the authority information corresponding to the version library ID. Among them, the authority information may also include the authority type and authority role, which are set according to actual needs, and the embodiment of the present invention does not limit it. The timing is set according to actual needs, such as 1 o'clock in the morning every day, and the embodiment of the present invention does not limit it.

[0101] After receiving the user operation permission information, the proxy server can calculate whether the user's permission has expired according to the current time and the permission expiration date included in the permission information corresponding to each version library of the user. If the user's permission has expired, the user ID is obtained, and the version library ID of the version library where the user's permission has expired is used as the cleanup information of the customer whose permission has expired. If the user has multiple permissions in the version library, the cleanup information of the customer whose permission has expired can also include the expired permission type. After obtaining the cleanup information of all users whose permissions have expired based on the user operation permission information, the proxy server sends a first user permission cleanup request to the third receiving unit 705. The first user permission cleanup request includes permission cleanup information, and the permission cleanup information includes the cleanup information of each customer whose permission has expired. The third receiving unit 705 receives the first user permission cleanup request.

[0102] After receiving the first user permission cleanup request sent by the proxy server, the first deletion unit 706 obtains permission cleanup information from the first user permission cleanup request, and then searches for the permission configuration file of the version library corresponding to the version library identifier included in the cleanup information according to each piece of cleanup information included in the permission cleanup information, and then deletes the relevant information of the user whose permission has expired included in the cleanup information from the permission configuration file of the corresponding version library. After the first deletion unit 706 completes processing of each piece of cleanup information included in the permission cleanup information, the cleanup of the operation permission of the user whose permission has expired is completed. Among them, the relevant information of the user whose permission has expired may include the user identifier, permission type, permission period, etc., which are set according to actual needs and are not limited in the embodiment of the present invention.

[0103] Fig. 9 is a schematic diagram of the structure of a control device for code operation permissions provided by a ninth embodiment of the present invention. Fig. 9 As shown, on the basis of the above embodiments, further, the control device for code operation permissions provided by the embodiment of the present invention further includes a fourth receiving unit 707 and a second deleting unit 708, wherein:

[0104] The fourth receiving unit 707 is used to receive a second user permission cleanup request sent by the proxy server, wherein the second user permission cleanup request includes user cleanup information; wherein the second user permission cleanup request is sent by the proxy server after querying and finding out that the user has resigned; the second deleting unit 708 is used to delete the relevant information of the resigned user from the permission configuration files of all version repositories according to the user cleanup information.

[0105] Specifically, the proxy server may query and obtain user status information from the user information management server, and the user status information includes whether the user is employed or has resigned. After the proxy server learns that the user has resigned through query, it may send a second user rights cleanup request to the fourth receiving unit 707, and the second user rights cleanup request includes user cleanup information, and the user cleanup information may include a user identifier of the resigned user. The fourth receiving unit 707 receives the second user rights cleanup request.

[0106] After receiving the second user permission cleanup request, the second deletion unit 708 can obtain user cleanup information from the second user permission cleanup request, and can delete the relevant information of the resigned user from the permission configuration file of each version library according to the user identifier included in the user cleanup information. The relevant information of the resigned user is the permission role, permission type, permission period and other information corresponding to the user identifier of the resigned user stored in the permission configuration file.

[0107] Fig.10is a schematic diagram of the structure of a control device for code operation permissions provided by the tenth embodiment of the present invention. Fig.10 As shown, on the basis of the above embodiments, further, the control device for code operation authority provided by the embodiment of the present invention further includes a sending unit 709, wherein:

[0108] The sending unit 709 is used to send the permission clearing result to the Web application server.

[0109] Specifically, after completing the cleaning of the operation rights of the user whose rights have expired according to the rights cleaning information, the sending unit 709 may send a rights cleaning result to the Web application server, and the rights cleaning result may include the user prompt information of expired rights and the rights cleaning information.

[0110] After completing the cleaning of the operation permissions of the resigned user according to the user cleaning information, the sending unit 709 may send a permission cleaning result to the Web application server, and the permission cleaning result may include prompt information of the resigned user and the user identifier of the resigned user.

[0111] The embodiments of the apparatus provided in the embodiments of the present invention can be specifically used to execute the processing flow of the above-mentioned method embodiments, and its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0112] It should be noted that the code operation authority control method and device 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 code operation authority control method and device.

[0113] Fig.11 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention, such as Fig.11As shown, the electronic device may include: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102 and the memory 1103 communicate with each other through the communication bus 1104. The processor 1101 may call the logic instructions in the memory 1103 to execute the following method: receiving an operation permission allocation request sent by a Web application server, the operation permission allocation request including user information, version library information and permission information; obtaining a permission configuration file of a corresponding version library according to the version library information, and writing the user information and permission information into the permission configuration file of the version library corresponding to the version library information and making the permission configuration file of the version library corresponding to the version library information effective; returning the permission allocation result to the Web application server.

[0114] In addition, when the logic instructions in the above-mentioned memory 1103 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0115] The present embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: receiving an operation permission allocation request sent by a Web application server, the operation permission allocation request including user information, version library information and permission information; obtaining a permission configuration file of a corresponding version library according to the version library information, and writing the user information and permission information into the permission configuration file of the version library corresponding to the version library information and making the permission configuration file of the version library corresponding to the version library information effective; returning the permission allocation result to the Web application server.

[0116] This embodiment provides a computer-readable storage medium, which stores a computer program. The computer program enables the computer to execute the methods provided by the above-mentioned method embodiments, for example, including: receiving an operation permission allocation request sent by a Web application server, the operation permission allocation request including user information, version library information and permission information; obtaining a permission configuration file of the corresponding version library according to the version library information, and writing the user information and permission information into the permission configuration file of the version library corresponding to the version library information and making the permission configuration file of the version library corresponding to the version library information effective; returning the permission allocation result to the Web application server.

[0117] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0118] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0121] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0122] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is 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 controlling code operation permissions, It is characterized in that include: Receive an operation authority allocation request sent by a Web application server, wherein the operation authority allocation request includes user information, version library information, and authority information; The permission information includes permission role, permission type, permission period, and permission expiration date. There is a corresponding relationship between the right role and the permission type; Obtaining a rights configuration file of the corresponding version library according to the version library information, and writing the user information and the rights configuration file into the rights configuration file of the version library corresponding to the version library information and making the rights configuration file of the version library corresponding to the version library information effective; Returning the permission allocation result to the Web application server; Receive a user authority period query request sent by a proxy server at regular intervals, and return user operation authority information to the proxy server; receiving a first user rights cleaning request sent by the proxy server, wherein the first user rights cleaning request includes rights cleaning information; wherein the first user rights cleaning request is sent by the proxy server after learning that there is a user whose rights have expired based on the user operation rights information; The relevant information of the user whose permissions have expired in the permission configuration file of the corresponding version library is deleted according to the permission cleanup information.

2. The method according to claim 1, It is characterized in that Also includes: receiving a second user rights cleaning request sent by the proxy server, wherein the second user rights cleaning request includes user cleaning information; wherein the second user rights cleaning request is sent by the proxy server after the proxy server learns that the user has resigned through query; Delete relevant information of the resigned user from the permission configuration files of all version repositories according to the user cleanup information.

3. The method according to claim 1 or 2, It is characterized in that Also includes: Send the permission cleanup result to the Web application server.

4. A device for controlling code operation permissions, It is characterized in that include: A first receiving unit is used to receive an operation authority allocation request sent by a Web application server, wherein the operation authority allocation request includes user information, version library information and authority information; The permission information includes permission role, permission type, permission period, and permission expiration date. There is a corresponding relationship between the right role and the permission type; A writing unit, used for obtaining a rights configuration file of a corresponding version library according to the version library information, and writing the user information and the rights configuration file into the rights configuration file of the version library corresponding to the version library information and making the rights configuration file of the version library corresponding to the version library information effective; A returning unit, used to return the permission allocation result to the Web application server; A second receiving unit is used to receive a user authority period query request sent by a proxy server at a fixed time, and return user operation authority information to the proxy server; A third receiving unit is configured to receive a first user rights cleaning request sent by the proxy server, wherein the first user rights cleaning request includes rights cleaning information; wherein the first user rights cleaning request is sent by the proxy server after learning that there is a user whose rights have expired based on the user operation rights information; The first deleting unit is used to delete the relevant information of the user whose authority has expired in the authority configuration file of the corresponding version library according to the authority cleaning information.

5. The device according to claim 4, It is characterized in that Also includes: a fourth receiving unit, configured to receive a second user rights cleaning request sent by the proxy server, wherein the second user rights cleaning request includes user cleaning information; wherein the second user rights cleaning request is sent by the proxy server after the proxy server learns that the user has resigned through query; The second deleting unit is used to delete the relevant information of the resigned user from the authority configuration files of all version repositories according to the user cleanup information.

6. The device according to claim 4 or 5, It is characterized in that Also includes: The sending unit is used to send the permission clearing result to the Web application server.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.