Permission verification method and device, electronic equipment and computer readable medium
By converting user permission information of different protocol types into a unified format and determining verification policies based on protocol type and file permission type, the access restriction problem caused by differences in file permission types in the storage system is solved, and the flexibility and permissions of the storage system are improved. Management efficiency.
Patent Information
- Application Number
- CN202410816660.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-11-12
AI Technical Summary
When the storage system connects multiple protocols at the same time, the file cannot be directly accessed by users of other protocols due to the limitation of the permission type, resulting in differences in permission settings and access restrictions.
By converting user permission information of different protocol types into a unified format, determining the target verification policy based on the user agreement type and file permission type, and performing permission verification, ensuring that the user has unified permission information when accessing files.
It avoids the problem that files created by different protocols cannot be accessed by users of other protocols due to permission type restrictions, and improves the flexibility of the storage system and the efficiency of permission management.
Smart Images

Figure CN118944907A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a permission verification method, device, electronic device and computer-readable medium. Background Art
[0002] As the storage business market expands, the application scenarios of storage systems are becoming more and more complex. The most prominent scenario is that a storage system is no longer used for only one file protocol, but needs to be connected with multiple file protocols. For example, when processing data, the NFS protocol (Network File System, Network File System Protocol, is one of the file systems supported by FreeBSD, also known as NFS. NFS allows a system to share directories and files with others on the network. By using the NFS protocol, users and programs can access files on remote systems like accessing local files.) or SMB protocol (Server Message Block, Server Message Block Protocol, a communication protocol for sharing files and printers on a local area network, which provides sharing services for resources such as files and printers between different computers in the local area network. The SMB protocol is a client / server protocol, through which the client can access the shared file system, printers and other resources on the server.) is usually used to connect to the storage system, while other protocols are used when reading and viewing data. This leads to a problem that the same file in the storage system may need to be accessed by two or more protocols.
[0003] In the related technology, during the data access process, different protocols may require different types of permissions. For example, when processing data, NFS protocol users need read and write permissions; when viewing data, in order to protect the security of the data, SMB protocol users are only allowed read permissions; or, after a protocol used in data processing processes specific user data to generate a file, the user of the protocol needs to set a specific user's permissions for the protocol that reads the data, allowing only this user to read the data results.
[0004] Therefore, when a storage system is connected to multiple protocols at the same time, files created by different protocols cannot be directly accessed by users of other protocols due to permission restrictions. This means that files created by different protocols may have different permission settings, resulting in users of some protocols being unable to directly access files created by other protocols. Summary of the invention
[0005] In view of this, embodiments of the present application provide a permission verification method, device, electronic device, and computer-readable medium to overcome the above-mentioned problems or at least partially solve the above-mentioned problems.
[0006] A first aspect of an embodiment of the present application provides a method for verifying permissions, the method comprising:
[0007] For the first target file, converting multiple permission information of multiple first original users with different protocol types into permission information in a unified format;
[0008] When the first original user sends an access request for the first target file to the storage system, based on the first protocol type of the first original user and the file permission type of the first target file, a target verification strategy for performing permission verification on the first original user is determined;
[0009] Under the target verification strategy, the first original user is subjected to a permission verification based on the permission information in the unified format.
[0010] Optionally, when the first original user issues an access request for the first target file to the storage system, determining a target verification strategy for performing permission verification on the first original user based on the first protocol type of the first original user and the file permission type of the first target file includes:
[0011] In the case where the first protocol type of the first original user matches the file permission type of the first target file, determining the target verification strategy as: directly performing permission verification on the first original user according to the first protocol type;
[0012] When the first protocol type of the first original user and the file permission type of the first target file do not match, the target verification strategy is determined as: according to the second protocol type corresponding to the file permission type of the first target file, a permission verification is performed on the first mapped user mapped from the first original user to the second protocol type.
[0013] Optionally, after the first original user issues an access request for the first target file to the storage system, the method further includes:
[0014] Based on the access request, obtaining permission information of the first target file in a unified format and a first protocol type of the first original user;
[0015] Determining the file permission type of the first target file according to the permission information in the unified format;
[0016] The step of performing permission verification on the first original user based on the permission information in the unified format under the target verification strategy includes:
[0017] When the first protocol type of the first original user matches the file permission type of the first target file, first original user information corresponding to the first original user is obtained from the permission information in the unified format according to the verification rule of the first protocol type, the first original user information is sent to the protocol layer of the storage system, and permission verification is performed on the first original user information of the first original user at the protocol layer;
[0018] In the case that the first protocol type of the first original user and the file permission type of the first target file do not match, first mapping user information of the first original user mapped to the first mapping user under the second protocol type is obtained from the permission information in the unified format, the first mapping user information is sent to the protocol layer, and a verification interface of the second protocol type encapsulated by the DFS layer is called to verify the first mapping user information of the first mapping user according to the verification rule of the second protocol type.
[0019] Optionally, before converting the plurality of permission information of the plurality of first original users with different protocol types into permission information in a unified format, the method further includes:
[0020] At the protocol layer, parsing multiple permission information issued by multiple first original users for the first target file;
[0021] Determining whether the first original user has setting authority, where the setting authority is the authority of the first original user to set permission information for the first target file in the storage system;
[0022] In the case that the first original user has setting permissions, the permission information of the first original user is converted into permission information in a unified format, where the permission information in the unified format is public permission information of the first original user under a default file permission type.
[0023] Optionally, converting the permission information of the first original user into permission information in a unified format includes:
[0024] Determining whether the first protocol type of the first original user matches the file permission type of the first target file;
[0025] When the first protocol type matches the file permission type of the first target file, directly converting the permission information of the first original user into permission information in a unified format;
[0026] In the case where the first protocol type does not match the file permission type of the first target file, mapping the first original user to a first mapped user having setting permissions for the first target file according to a second protocol type corresponding to the file permission type of the first target file, and converting the permission information of the first mapped user for the first target file into permission information in a unified format;
[0027] The method further includes: sending the permission information converted into a unified format to a DFS layer of a storage system for storage, and returning the setting result of the permission information to the first original user.
[0028] Optionally, the method further comprises:
[0029] When receiving a permission information viewing request for a second target file initiated by a second original user to the storage system, determining whether the third protocol type of the second original user matches the file permission type of the second target file based on the permission information in a unified format corresponding to the second target file;
[0030] In the case where the third protocol type matches the file permission type of the second target file, querying the permission information of the first original user for the second target file from the permission information in a unified format corresponding to the second target file, and returning the second original user;
[0031] In the case that the third protocol type does not match the file permission type of the second target file, the second original user is mapped to the second mapped user under the fourth protocol type according to the fourth protocol type corresponding to the file permission type of the second target file, the permission information of the second mapped user for the second target file is queried from the permission information in a unified format corresponding to the second target file, the permission information of the second mapped user for the second target file is converted into permission information in a format of the third protocol type, and the permission information converted into a format of the third protocol type is returned to the second original user.
[0032] Optionally, after determining whether the third protocol type of the second original user matches the file permission type of the second target file, the method further includes:
[0033] In the case where the third protocol type matches the file permission type of the second target file, verifying whether the second original user has query permission for the permission information of the second target file, and returning the permission information of the second original user for the second target file to the second original user when the second original user has the query permission;
[0034] In the case that the third protocol type does not match the file permission type of the second target file, it is checked whether the second mapped user has the query permission for the permission information of the second target file; when the second mapped user has the query permission, the permission information converted into the format of the second protocol type is returned to the second original user.
[0035] A second aspect of an embodiment of the present application provides a permission verification device, the device comprising:
[0036] A conversion module, configured to convert, for the first target file, a plurality of permission information of a plurality of first original users with different protocol types into permission information in a unified format;
[0037] a target verification strategy determination module, configured to determine, when a first original user issues an access request for the first target file to the storage system, a target verification strategy for performing permission verification on the first original user based on a first protocol type of the first original user and a file permission type of the first target file;
[0038] The permission verification module is used to perform permission verification on the first original user based on the permission information in the unified format under the target verification strategy.
[0039] A third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the permission verification method as described in the first aspect.
[0040] A fourth aspect of an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the permission verification method as described in the first aspect is implemented.
[0041] Beneficial effects of this application:
[0042] An embodiment of the present application provides a permission verification method, device, electronic device and computer-readable medium, the method comprising: for a first target file, converting multiple permission information of multiple first original users with different protocol types into permission information in a unified format; when the first original user issues an access request for the first target file to a storage system, based on the first protocol type of the first original user and the file permission type of the first target file, determining a target verification strategy for performing permission verification on the first original user; under the target verification strategy, performing permission verification on the first original user based on the permission information in the unified format.
[0043] In the process of performing permission verification on the first original user and the first target file in the storage system, permission information of different protocols corresponding to multiple users is converted into permission information in a unified format in advance for the first target file in the storage system. When the first original user accesses the first target file, a target verification strategy can be determined according to the relationship between the first protocol type of the first original user and the file permission type of the first target file, and the first original user can be verified based on the permission information in the unified format, which can ensure that the user has unified permission information when accessing the first target file, avoids the situation where files in storage systems connected to different protocols cannot be accessed by users of other protocols due to restrictions on permission types, and improves the flexibility of the storage system. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application.
[0045] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the description of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 It is a flowchart of a permission verification method provided by an embodiment of the present application;
[0047] Figure 2 It is a schematic diagram of each layer of a storage system in a permission verification method provided in an embodiment of the present application;
[0048] Figure 3 It is a schematic diagram of processing logic for performing permission verification in a protocol layer provided by an embodiment of the present application;
[0049] Figure 4 It is a schematic diagram of a processing logic of protocol layer permission setting provided by an embodiment of the present application;
[0050] Figure 5 It is a schematic diagram of a processing logic for checking protocol layer permissions provided by an embodiment of the present application;
[0051] Figure 6 It is a schematic diagram of a framework of a permission verification device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0052] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application may be combined with each other.
[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0054] Based on the content of the background technology, the present application provides a permission verification method, device, electronic device and computer-readable medium to solve the problem that when a storage system is connected to multiple protocols at the same time, files created by different protocols cannot be directly accessed by users of other protocols due to permission restrictions.
[0055] The technical solution of the present application will be described in detail below with reference to a number of embodiments.
[0056] Figure 1 is a flowchart of a permission verification method provided by an embodiment of the present application, such as Figure 1 As shown, an embodiment of the present application provides a permission verification method, the method comprising:
[0057] In step S101, for a first target file, multiple permission information of multiple first original users with different protocol types are converted into permission information in a unified format;
[0058] In step S102, when the first original user sends an access request for the first target file to the storage system, a target verification strategy for performing permission verification on the first original user is determined based on the first protocol type of the first original user and the file permission type of the first target file;
[0059] In step S103, under the target verification strategy, based on the permission information in the unified format, the first original user is subjected to permission verification.
[0060] First, the embodiment of the present application proposes a technical concept of storing the permission information of a file in a unified format in the bottom layer of the storage system (for example, the DFS (Distributed File System) layer, an interface call layer between the protocol layer and the metadata layer). In step S101, the first target file is a file created by a user in the storage system based on a certain protocol (for example, the SMB protocol or the NFS protocol), and the storage format of multiple permission information corresponding to multiple first original users of different protocol types in the DFS layer is the same. In the storage system, each first target file is associated with permission information of multiple protocol types corresponding to the first target file, that is, each first target file corresponds to permission information of a unified format, and the permission information of the unified format includes the permission information of multiple first original users of different protocol types corresponding to the first target file for the first target file. In this process, a mechanism such as an access control list (ACL) or a role-based access control (RBAC) can be used to associate the first target file with multiple permission information to obtain permission information in a unified format to ensure that each protocol type follows the same permission management policy.
[0061] Further, in step S102, the first original user is a user in the storage system who needs to request access to the first target file. When the first original user needs to access the first target file, it is necessary to send an access request for the first target file to the storage system. It should be understood that when the storage system receives the access request from the first original user, it can directly determine the first protocol type of the first original user, such as authenticating the first original user through the NTLM authentication protocol, and determining the protocol type of the first original user, which is the first protocol type (for example, the SMB protocol or the NFS protocol). At the same time, the access request includes relevant information of the first target file, and then the file permission type of the first target file is obtained through the relevant information. For example, when the file permission type of the first target file is SMB, it indicates that the first target file is created based on the SMB protocol. At this time, the access rights of the first target file are set according to the rules of the SMB protocol.
[0062] After determining the first protocol type of the first original user and the file permission type of the first target file, a target verification strategy for performing permission verification on the first original user can be determined based on the relationship between the first protocol type of the first original user and the file permission type of the first target file. In other words, the target verification strategy is determined based on the relationship between the first protocol type of the first original user and the file permission type of the first target file.
[0063] Finally, in step S103, under the guidance of the target verification strategy, the first original user is verified for permissions based on the permission information in a unified format. In this process, the protocol layer of the storage system uses the permission information in a unified format to verify the permissions of the first original user according to the determined target verification strategy. This verification process may involve operations such as user identity verification and permission verification to verify whether the first original user has a legitimate identity and access to the first target file.
[0064] Through the above embodiments, in the process of performing permission verification on the first original user and the first target file in the storage system, the permission information of different protocols corresponding to multiple users is converted into permission information in a unified format in advance for the first target file in the storage system. When the first original user accesses the first target file, the target verification strategy can be determined according to the relationship between the first protocol type of the first original user and the file permission type of the first target file, and the first original user can be verified based on the permission information in the unified format, which can ensure that the user has unified permission information when accessing the first target file, and avoid the situation where files in storage systems connected to different protocols cannot be accessed by users of other protocols due to restrictions on permission types.
[0065] Figure 2 is a schematic diagram of each layer of a storage system in a permission verification method provided in an embodiment of the present application, such as Figure 2 As shown in the figure, from top to bottom, they are the client, protocol layer, and DFS layer. The client is responsible for sending operation requests for target files to the protocol layer of the storage system. The protocol layer implements the judgment of file permission type, permission verification process, and permission mapping search process. The DFS layer is responsible for storing permission information, including storing permission information in a unified format, the permission conversion process, and directly or indirectly transmitting permission information to the protocol layer and the client.
[0066] Optionally, the step S102 includes:
[0067] In the case where the first protocol type of the first original user matches the file permission type of the first target file, determining the target verification strategy as: directly performing permission verification on the first original user according to the first protocol type;
[0068] When the first protocol type of the first original user and the file permission type of the first target file do not match, the target verification strategy is determined as: according to the second protocol type corresponding to the file permission type of the first target file, a permission verification is performed on the first mapped user mapped from the first original user to the second protocol type.
[0069] Specifically, in the embodiment of the present application, different target verification strategies are determined based on the matching relationship between the first protocol type of the first original user and the file permission type of the first target file.
[0070] In the case where the first protocol type of the first original user matches the file permission type of the first target file, for example, the first target file is created based on the SMB protocol, then the file permission type is SMB, and the first original user is a user who uses the SMB protocol for file sharing and network communication, then the first protocol type of the first original user is also SMB. Therefore, in this case, it can be determined that the first protocol type of the first original user matches the file permission type of the first target file. Further, in this case where the two match, the target verification strategy determined is: directly perform permission verification on the first original user at the protocol layer of the storage system according to the first protocol type.
[0071] In the case where the first protocol type of the first original user and the file permission type of the first target file do not match, for example, the first target file is created based on the SMB protocol, then the file permission type is SMB, and the first original user is a user who uses the NFS protocol for file sharing and network communication, then the first protocol type of the first original user is NFS, at this time, the first protocol type of the first original user and the file permission type of the first target file do not match, in this case where the two do not match, the target verification strategy determined is: according to the second protocol type corresponding to the file permission type of the first target file, the first original user is mapped to the first mapped user under the second protocol type for permission verification. At this time, the second protocol type is SMB, and the first original user needs to be mapped to the first mapped user with the protocol type of SMB first, and the first mapped user is subjected to permission verification, and then the verification result is returned to the first original user, and the verification result for the first mapped user indicates whether the first original user can access the first target file.
[0072] Through the above embodiments, it is possible to determine the target verification strategy of different processing logics to perform permission verification based on whether the first protocol type of the first original user and the file permission type of the first target file match, thereby improving the flexibility of permission verification in storage systems connected to different protocols.
[0073] Optionally, after the first original user issues an access request for the first target file to the storage system, the method further includes:
[0074] Based on the access request, obtaining permission information of the first target file in a unified format and a first protocol type of the first original user;
[0075] Determining the file permission type of the first target file according to the permission information in the unified format;
[0076] The step of performing permission verification on the first original user based on the permission information in the unified format under the target verification strategy includes:
[0077] When the first protocol type of the first original user matches the file permission type of the first target file, first original user information corresponding to the first original user is obtained from the permission information in the unified format according to the verification rule of the first protocol type, the first original user information is sent to the protocol layer of the storage system, and permission verification is performed on the first original user information of the first original user at the protocol layer;
[0078] In the case that the first protocol type of the first original user and the file permission type of the first target file do not match, first mapping user information of the first original user mapped to the first mapping user under the second protocol type is obtained from the permission information in the unified format, the first mapping user information is sent to the protocol layer, and a verification interface of the second protocol type encapsulated by the DFS layer is called to verify the first mapping user information of the first mapping user according to the verification rule of the second protocol type.
[0079] Figure 3 is a schematic diagram of a processing logic for performing permission verification in a protocol layer provided by an embodiment of the present application, such as Figure 3 shown.
[0080] Specifically, in an embodiment of the present application, after the first original user issues an access request for the first target file to the protocol layer of the storage system on the client, the protocol layer obtains permission information in a unified format associated with the first target file and the first protocol type of the first original user in the DFS layer based on the access request issued by the first original user, the access request including relevant information of the first target file, and determines the file permission type of the first target file based on the permission information in a unified format associated with the first target file, sends the file permission type of the first target file to the protocol layer, and matches the file permission type of the first target file with the first protocol type of the first original user at the protocol layer. If they are consistent, it indicates that the match is successful. At this time, the permission of the first original user is directly checked at the protocol layer of the storage system according to the first protocol type. When the check passes, the subsequent access process of the first target file continues. When the check passes, a rejection is returned to the client of the first original user.
[0081] When there is inconsistency, it means that the match is unsuccessful. At this time, it is necessary to first map the first original user to the first mapped user in the second protocol type corresponding to the file permission type of the first target file, and realize the conversion of the permission information of the first original user into the permission information of the first mapped user, and return the query result of the permission information of the first mapped user to the protocol layer. At the same time, call the verification interface of the second protocol type encapsulated by the DFS layer, and perform permission verification on the first mapped user at the protocol layer according to the verification rules of the second protocol type, and then return the verification result to the first original user. The verification result for the first mapped user indicates whether the first original user can access the first target file. When the verification passes, the subsequent access process of the first target file continues. When the verification passes, a rejection is returned to the client of the first original user.
[0082] Through the above embodiments, according to whether the first protocol type of the first original user matches the file permission type of the first target file, the target verification strategy of different processing logics is determined to perform permission verification, thereby improving the flexibility of permission verification in storage systems connected to different protocols. In addition, the technical solution of the present application moves the permission verification of the DFS layer to the protocol layer, so that the entire verification process is at the protocol layer, and the DFS layer can focus on processing file read, write, open, delete and other requests, thereby averaging the pressure on the protocol layer and the DFS layer and improving the performance of the storage system.
[0083] Optionally, before step S101, the method further includes:
[0084] At the protocol layer, parsing multiple permission information issued by multiple first original users for the first target file;
[0085] Determining whether the first original user has setting authority, where the setting authority is the authority of the first original user to set permission information for the first target file in the storage system;
[0086] In the case that the first original user has setting permissions, the permission information of the first original user is converted into permission information in a unified format, where the permission information in the unified format is public permission information of the first original user under a default file permission type.
[0087] Figure 4 is a schematic diagram of a processing logic for setting protocol layer permissions provided by an embodiment of the present application, such as Figure 4 shown.
[0088] Specifically, in an embodiment of the present application, at the protocol layer, permission information of multiple existing first original users can be obtained, and the first original users can change, delete, add, and other operations on the existing permission information on the client, and new first original users can be added at the protocol layer. Before the first original user sends an access request for the first target file to the storage system, the permission information sent by the client is parsed, and at the protocol layer, it is verified whether the multiple first original users have the setting permission. The setting permission is the permission of the first original user to set the permission information for the first target file in the storage system. If the first original user has the setting permission, the permission information of the first original user can be converted into permission information in a unified format. If the first original user does not have the setting permission, a rejection is returned to the client of the first original user.
[0089] For multiple first original users with setting permissions, the permission information of these first original users is converted into permission information in a unified format, wherein the permission information in a unified format is the public permission information of the first original users under the default file permission type, and the permission information in a unified format is sent down to the DFS layer for storage. After the DFS layer receives the permission information in a unified format sent down by the protocol layer, it can write the permission information in a unified format into the underlying storage by overwriting, and return the setting result of the permission information to the protocol layer, and the protocol layer then uploads the setting result to the client.
[0090] Through the above embodiment, it is possible to set the permission information of the first target file at the protocol layer, and convert it into permission information of a unified format and store it at the bottom layer.
[0091] Optionally, converting the permission information of the first original user into permission information in a unified format includes:
[0092] Determining whether the first protocol type of the first original user matches the file permission type of the first target file;
[0093] When the first protocol type matches the file permission type of the first target file, directly converting the permission information of the first original user into permission information in a unified format;
[0094] In the case where the first protocol type does not match the file permission type of the first target file, mapping the first original user to a first mapped user having setting permissions for the first target file according to a second protocol type corresponding to the file permission type of the first target file, and converting the permission information of the first mapped user for the first target file into permission information in a unified format;
[0095] The method further includes: sending the permission information converted into a unified format to a DFS layer of a storage system for storage, and returning the setting result of the permission information to the first original user.
[0096] Specifically, Figure 4 As shown, in the embodiment of the present application, in the process of setting the permission information, it is also necessary to consider whether the first protocol type of the first original user matches the file permission type of the first target file. Therefore, it is divided into two cases. First, when the first protocol type matches the file permission type of the first target file, there is no need to convert the protocol type at this time, but the permission information of the first original user can be directly converted into permission information in a unified format and stored in the DFS layer. Second, when the first protocol type does not match the file permission type of the first target file, at this time, the permission information of the first original user cannot be directly converted into permission information in a unified format for storage, but needs to be converted into the protocol type first, and the permission information is stored in the unified format according to the file permission type of the first target file. The second protocol type corresponding to the type should be noted that when there is no change in the permission information of the protocol type of the first target file, the second protocol type is the protocol type when the first target file is created. Further, the first original user is mapped to the first mapped user with setting permissions for the first target file. At this time, the setting permissions of the first mapped user also need to be verified, and the permission information of the first mapped user for the first target file is converted into permission information in a unified format and stored in the DFS layer. When the permission information of the first original user needs to be verified later, the permission information converted into a unified format by the first mapped user for the first target file stored in the DFS can be verified to determine whether the first original user can access the first target file.
[0097] Furthermore, after the converted unified format permission information is sent to the DFS layer of the storage system for storage, the setting result of the permission information still needs to be returned to the first original user to inform the first original user of the permission setting result.
[0098] Through the above embodiment, it is possible to consider whether the first protocol type of the first original user matches the file permission type of the first target file to perform permission setting, to ensure that when the permission information in a unified format is subsequently checked, when the first protocol type of the first original user does not match the file permission type of the first target file, the first mapped user of the first original user can be checked for permissions through permission mapping to determine whether the permission information of the first original user has passed the verification.
[0099] Figure 5 It is a schematic diagram of the processing logic of protocol layer permission viewing provided by an embodiment of the present application.
[0100] Optionally, the method further comprises:
[0101] When receiving a permission information viewing request for a second target file initiated by a second original user to the storage system, determining whether the third protocol type of the second original user matches the file permission type of the second target file based on the permission information in a unified format corresponding to the second target file;
[0102] In the case where the third protocol type matches the file permission type of the second target file, querying the permission information of the first original user for the second target file from the permission information in a unified format corresponding to the second target file, and returning the second original user;
[0103] In the case that the third protocol type does not match the file permission type of the second target file, the second original user is mapped to the second mapped user under the fourth protocol type according to the fourth protocol type corresponding to the file permission type of the second target file, the permission information of the second mapped user for the second target file is queried from the permission information in a unified format corresponding to the second target file, the permission information of the second mapped user for the second target file is converted into permission information in a format of the third protocol type, and the permission information converted into a format of the third protocol type is returned to the second original user.
[0104] Specifically, Figure 5 As shown, in an embodiment of the present application, the client can also view the permission information in a unified format that has been stored through the protocol layer. First, the second original user is a user in the storage system who needs to view the permission information in a unified format that has been stored. When the storage system receives a request from the second original user to view the permission information of the second target file, the storage system determines whether the third protocol type of the second original user matches the file permission type of the second target file based on the permission information in a unified format corresponding to the second target file. The method for obtaining the third protocol type and the file permission type of the second target file is similar to the method described in the above embodiment and will not be repeated.
[0105] When, after verification at the protocol layer, it is determined that the third protocol type matches the file permission type of the second target file, the storage system will query the second original user's permission information for the second target file from the permission information in a unified format corresponding to the second target file, and return the second original user's permission information for the second target file to the second original user, so that the second original user can obtain the permission information for the second target file.
[0106] In addition, when the second original user has full access rights to the permission information in the unified format for the second target file, the second original user can also obtain the entire content of the permission information in the unified format.
[0107] When the third protocol type does not match the file permission type of the second target file, the storage system will map the second original user to the second mapped user under the fourth protocol type according to the fourth protocol type corresponding to the file permission type of the second target file. Then the storage system will query the permission information of the second mapped user for the second target file from the permission information in the unified format corresponding to the second target file, and convert the permission information into permission information in the format of the third protocol type, and then return the converted permission information to the second original user.
[0108] Through the above embodiment, the second original user's request to view the second target file's permission information can be processed by matching the protocol type and performing mapping conversion. According to different situations, the storage system can directly query the permission information of the first original user or perform mapping and format conversion to meet the second original user's permission information viewing needs.
[0109] Optionally, after determining whether the third protocol type of the second original user matches the file permission type of the second target file, the method further includes:
[0110] In the case where the third protocol type matches the file permission type of the second target file, verifying whether the second original user has query permission for the permission information of the second target file, and returning the permission information of the second original user for the second target file to the second original user when the second original user has the query permission;
[0111] In the case that the third protocol type does not match the file permission type of the second target file, it is checked whether the second mapped user has the query permission for the permission information of the second target file; when the second mapped user has the query permission, the permission information converted into the format of the second protocol type is returned to the second original user.
[0112] Specifically, in the embodiment of the present application, after matching the third protocol type and the file permission type of the second target file, further permission verification and return operations are required.
[0113] When the third protocol type matches the file permission type of the second target file, the storage system will perform a permission check to check whether the second original user has the permission to query the permission information of the second target file. If the second original user has the permission to query, the storage system will return the permission information of the second original user to the second original user.
[0114] In the case that the third protocol type does not match the file permission type of the second target file, the storage system will perform a permission check to check whether the second mapped user has the query permission for the permission information of the second target file. If the second mapped user has the query permission, the storage system will return the permission information converted into the format of the second protocol type to the second original user.
[0115] Through the above embodiment, when the protocol type matches, the query permission of the second original user can be verified and the corresponding permission information can be returned. When the protocol type does not match, the storage system verifies the query permission of the second mapped user and returns the converted permission information. This ensures that the second original user can only obtain the permission information of the target file for which he has the query permission, thereby ensuring the security and legality of the permission information.
[0116] Optionally, the correspondence between the first original user and the first mapped user, and between the second original user and the second mapped user is recorded in the form of a two-dimensional mapping relationship table on the management interface of the storage system and managed by the administrator of the storage system. In one embodiment, the first original user and the first mapped user may correspond to the same user A. The first original user represents the account of user A in user group a, and the first mapped user represents the account of user A in user group b. In this case, the first original user and the first mapped user are divided into different protocols. For example, the first original user (i.e., user A in user group a) corresponds to the SMB protocol, and the first mapped user (i.e., user A in user group b) corresponds to the NFS protocol. Although both correspond to user A, , which is equivalent to two users in the storage system. In this case, through the technical solution of the embodiment of the present application, when the corresponding protocol is the SMB protocol and the first original user (that is, user A in user group a) needs to request the first target file of the NFS protocol, at this time, the corresponding protocol can be the first mapped user of the NFS protocol (that is, user A in user group b) to perform permission verification to determine whether the first original user (that is, user A in user group a) can access the first target file of the NFS protocol, thereby achieving in the process of permission verification, through the permission mapping method, combining the two identities of user A (the first original user and the first mapped user), thereby improving the flexibility of the permission verification process of the storage system connected to multiple protocols.
[0117] It should be noted that there is no practical difference between the first original user and the second original user of the present application. When the actual user corresponding to the second original user requests to access a file, he or she can also act as the first original user and perform permission setting and permission verification through the method of the above embodiment; when the actual user corresponding to the first original user performs a permission query, he or she can also act as the second original user and perform a permission query through the method of the above embodiment.
[0118] Furthermore, when the actual user of the first mapped user needs to request to access a file or query permissions, he or she may also act as the first original user or the second original user to perform permission setting, permission verification and permission query through the method of the above embodiment, and the actual user of the second mapped user is similar.
[0119] Figure 6 is a schematic diagram of a framework of a permission verification device provided by an embodiment of the present application, such as Figure 6 As shown, an embodiment of the present application provides a permission verification device, the device comprising:
[0120] The conversion module 11 is used to convert, for the first target file, a plurality of permission information of a plurality of first original users with different protocol types into permission information in a unified format;
[0121] A target verification strategy determination module 12 is used to determine a target verification strategy for performing permission verification on the first original user based on the first protocol type of the first original user and the file permission type of the first target file when the first original user issues an access request for the first target file to the storage system;
[0122] The permission verification module 13 is used to perform permission verification on the first original user based on the permission information in the unified format under the target verification strategy.
[0123] Optionally, the target verification strategy determination module 12 includes:
[0124] A first target verification strategy determining unit is used to determine the target verification strategy as: directly performing permission verification on the first original user according to the first protocol type when the first protocol type of the first original user matches the file permission type of the first target file;
[0125] A second target verification strategy determination unit is used to determine the target verification strategy as follows: when the first protocol type of the first original user and the file permission type of the first target file do not match, performing permission verification on the first mapped user mapped from the first original user to the second protocol type according to the second protocol type corresponding to the file permission type of the first target file.
[0126] Optionally, the device further comprises:
[0127] an acquisition module, configured to acquire, after a first original user issues an access request for the first target file to the storage system, permission information of the first target file in a unified format and a first protocol type of the first original user based on the access request;
[0128] A file permission type determination module, used to determine the file permission type of the first target file according to the permission information in the unified format;
[0129] The authority verification module 13 includes:
[0130] a first permission verification unit, configured to, when a first protocol type of the first original user matches a file permission type of the first target file, obtain first original user information corresponding to the first original user from the permission information in the unified format according to a verification rule of the first protocol type, send the first original user information to a protocol layer of the storage system, and perform permission verification on the first original user information of the first original user at the protocol layer;
[0131] A second permission verification unit is used to obtain, from the permission information in the unified format, first mapping user information of the first original user mapped to the first mapped user under the second protocol type when the first protocol type of the first original user and the file permission type of the first target file do not match, send the first mapping user information to the protocol layer, call the verification interface of the second protocol type encapsulated by the DFS layer, and verify the first mapping user information of the first mapping user according to the verification rules of the second protocol type.
[0132] Optionally, the device further comprises:
[0133] a parsing module, configured to parse, at the protocol layer, the plurality of permission information issued by the plurality of first original users for the first target file before converting the plurality of permission information of the plurality of first original users with different protocol types into permission information in a unified format;
[0134] a judgment module, configured to judge whether the first original user has setting authority, wherein the setting authority is an authority of the first original user to set permission information for the first target file in the storage system;
[0135] The conversion unit is used to convert the permission information of the first original user into permission information in a unified format when the first original user has setting permissions, wherein the permission information in the unified format is public permission information of the first original user under a default file permission type.
[0136] Optionally, the conversion unit includes:
[0137] A first matching unit, configured to determine whether a first protocol type of the first original user matches a file permission type of the first target file;
[0138] A first conversion subunit is used to directly convert the permission information of the first original user into permission information in a unified format when the first protocol type matches the file permission type of the first target file;
[0139] a second conversion subunit, configured to map the first original user to a first mapped user having setting permissions for the first target file according to a second protocol type corresponding to the file permission type of the first target file when the first protocol type does not match the file permission type of the first target file, and convert the permission information of the first mapped user for the first target file into permission information in a unified format;
[0140] The device further includes: a storage module, which is used to send the permission information converted into a unified format to the DFS layer of the storage system for storage, and return the setting result of the permission information to the first original user.
[0141] Optionally, the device further comprises:
[0142] a second matching unit, configured to, when receiving a request from a second original user to the storage system for viewing permission information of a second target file, determine whether the third protocol type of the second original user matches the file permission type of the second target file based on the permission information in a unified format corresponding to the second target file;
[0143] a first query unit, configured to query permission information of the first original user for the second target file from permission information in a unified format corresponding to the second target file, and return the second original user, when the third protocol type matches the file permission type of the second target file;
[0144] A second query unit is used to map the second original user to a second mapped user under the fourth protocol type according to the fourth protocol type corresponding to the file permission type of the second target file when the third protocol type does not match the file permission type of the second target file, query the permission information of the second mapped user for the second target file from the permission information in a unified format corresponding to the second target file, convert the permission information of the second mapped user for the second target file into permission information in a format of the third protocol type, and return the permission information converted into a format of the third protocol type to the second original user.
[0145] Optionally, the device further comprises:
[0146] a first query permission verification module, configured to, after determining whether the third protocol type of the second original user matches the file permission type of the second target file, verify whether the second original user has query permission for the permission information of the second target file if the third protocol type matches the file permission type of the second target file, and return the permission information of the second original user for the second target file to the second original user if the second original user has query permission;
[0147] A second query permission verification module is used to verify whether the second mapped user has query permission for the permission information of the second target file when the third protocol type does not match the file permission type of the second target file. When the second mapped user has query permission, the permission information converted into the format of the second protocol type is returned to the second original user.
[0148] Based on the same inventive concept, another embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the permission verification method as described in any of the above embodiments.
[0149] Based on the same inventive concept, another embodiment of the present application further provides a computer program product, including a computer program, which is executed by a processor to perform the permission verification method described in any of the above embodiments.
[0150] Based on the same inventive concept, another embodiment of the present application further provides a computer-readable medium on which a computer program is stored, wherein when the program is executed by a processor, the permission verification method as described in any of the above embodiments is implemented.
[0151] As for the device, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0152] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0153] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt 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.
[0154] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal 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.
[0155] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including 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.
[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0157] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0158] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0159] The above is a detailed introduction to a permission verification method, device, electronic device, and computer-readable medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A permission verification method, characterized in that: The method comprises: For the first target file, converting multiple permission information of multiple first original users with different protocol types into permission information in a unified format; When the first original user sends an access request for the first target file to the storage system, based on the first protocol type of the first original user and the file permission type of the first target file, a target verification strategy for performing permission verification on the first original user is determined; Under the target verification strategy, the first original user is subjected to a permission verification based on the permission information in the unified format.
2. The permission verification method according to claim 1, characterized in that: When the first original user issues an access request for the first target file to the storage system, based on the first protocol type of the first original user and the file permission type of the first target file, a target verification strategy for performing permission verification on the first original user is determined, including: In the case where the first protocol type of the first original user matches the file permission type of the first target file, determining the target verification strategy as: directly performing permission verification on the first original user according to the first protocol type; When the first protocol type of the first original user and the file permission type of the first target file do not match, the target verification strategy is determined as: according to the second protocol type corresponding to the file permission type of the first target file, a permission verification is performed on the first mapped user mapped from the first original user to the second protocol type.
3. The permission verification method according to claim 2, characterized in that: After the first original user issues an access request for the first target file to the storage system, the method further includes: Based on the access request, obtaining permission information of the first target file in a unified format and a first protocol type of the first original user; Determining the file permission type of the first target file according to the permission information in the unified format; The step of performing permission verification on the first original user based on the permission information in the unified format under the target verification strategy includes: When the first protocol type of the first original user matches the file permission type of the first target file, first original user information corresponding to the first original user is obtained from the permission information in the unified format according to the verification rule of the first protocol type, the first original user information is sent to the protocol layer of the storage system, and permission verification is performed on the first original user information of the first original user at the protocol layer; In the case that the first protocol type of the first original user and the file permission type of the first target file do not match, first mapping user information of the first original user mapped to the first mapping user under the second protocol type is obtained from the permission information in the unified format, the first mapping user information is sent to the protocol layer, and a verification interface of the second protocol type encapsulated by the DFS layer is called to verify the first mapping user information of the first mapping user according to the verification rule of the second protocol type.
4. The permission verification method according to claim 1, characterized in that: Before converting the plurality of permission information of the plurality of first original users with different protocol types into permission information in a unified format, the method further includes: At the protocol layer, parsing multiple permission information issued by multiple first original users for the first target file; Determining whether the first original user has setting authority, where the setting authority is the authority of the first original user to set permission information for the first target file in the storage system; In the case that the first original user has setting permissions, the permission information of the first original user is converted into permission information in a unified format, where the permission information in the unified format is public permission information of the first original user under a default file permission type.
5. The permission verification method according to claim 4, characterized in that: The step of converting the permission information of the first original user into permission information in a unified format includes: Determining whether the first protocol type of the first original user matches the file permission type of the first target file; When the first protocol type matches the file permission type of the first target file, directly converting the permission information of the first original user into permission information in a unified format; In the case where the first protocol type does not match the file permission type of the first target file, mapping the first original user to a first mapped user having setting permissions for the first target file according to a second protocol type corresponding to the file permission type of the first target file, and converting the permission information of the first mapped user for the first target file into permission information in a unified format; The method further includes: sending the permission information converted into a unified format to a DFS layer of a storage system for storage, and returning the setting result of the permission information to the first original user.
6. The permission verification method according to claim 1, characterized in that: The method further comprises: When receiving a permission information viewing request for a second target file initiated by a second original user to the storage system, determining whether the third protocol type of the second original user matches the file permission type of the second target file based on the permission information in a unified format corresponding to the second target file; In the case where the third protocol type matches the file permission type of the second target file, querying the permission information of the first original user for the second target file from the permission information in a unified format corresponding to the second target file, and returning the second original user; In the case that the third protocol type does not match the file permission type of the second target file, the second original user is mapped to the second mapped user under the fourth protocol type according to the fourth protocol type corresponding to the file permission type of the second target file, the permission information of the second mapped user for the second target file is queried from the permission information in a unified format corresponding to the second target file, the permission information of the second mapped user for the second target file is converted into permission information in a format of the third protocol type, and the permission information converted into a format of the third protocol type is returned to the second original user.
7. The permission verification method according to claim 6, characterized in that: After determining whether the third protocol type of the second original user matches the file permission type of the second target file, the method further includes: In the case where the third protocol type matches the file permission type of the second target file, verifying whether the second original user has query permission for the permission information of the second target file, and returning the permission information of the second original user for the second target file to the second original user when the second original user has the query permission; In the case that the third protocol type does not match the file permission type of the second target file, it is checked whether the second mapped user has the query permission for the permission information of the second target file; when the second mapped user has the query permission, the permission information converted into the format of the second protocol type is returned to the second original user.
8. A permission verification device, characterized in that: The device comprises: A conversion module, configured to convert, for the first target file, a plurality of permission information of a plurality of first original users with different protocol types into permission information in a unified format; a target verification strategy determination module, configured to determine, when a first original user issues an access request for the first target file to the storage system, a target verification strategy for performing permission verification on the first original user based on a first protocol type of the first original user and a file permission type of the first target file; The permission verification module is used to perform permission verification on the first original user based on the permission information in the unified format under the target verification strategy.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the permission verification method according to any one of claims 1 to 7.
10. A computer-readable medium, characterized in that A computer program is stored thereon, wherein when the computer program is executed by a processor, the permission verification method as described in any one of claims 1 to 7 is implemented.
