Authorization gating method and system based on multi-tenant source code image similarity governance
By constructing a trusted identity tuple and application authorization relationship graph, and combining file change events and multi-dimensional scoring, the full lifecycle problem of source code reuse governance in multi-tenant application stores is solved. This enables accurate authorization status determination and real-time risk warning, reduces computation and network overhead, and supports efficient source code governance and evidence preservation.
Patent Information
- Application Number
- CN202611668275.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-27
- Publication Date
- 2026-11-27
AI Technical Summary
Existing source code plagiarism detection or code clone detection solutions lack a full lifecycle governance mechanism in multi-tenant app stores. They cannot continuously provide similarity risk warnings during the development process and have difficulty distinguishing between different authorization statuses and reuse scenarios, leading to source code leakage and intellectual property risks.
By constructing a trusted identity tuple and an application authorization relationship graph, and building a source code profile based on incremental file change events, multi-dimensional scoring and authorization relationship determination are performed to generate verifiable evidence summaries, enabling early warning during development and mandatory gating during release.
It enables the reuse of source code that accurately distinguishes different authorization states in a multi-tenant environment, reduces network and computing overhead, improves responsiveness, supports real-time governance and evidence retention, and reduces the risk of unauthorized reuse.
Smart Images

Figure CN123179367A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software detection technology, and in particular to an authorization gating method and system based on multi-tenant source code profile similarity governance. Background Technology
[0002] With the development of enterprise-level app stores, online development workbench, plug-in software delivery, and multi-tenant cloud development environments, software service providers can complete application template creation, source code import, plugin preview, build and package, and submit for app store submission all within a browser. These development tools are typically integrated with app stores, object storage, container scheduling, reverse proxies, and permission systems to provide isolated development spaces for different service providers and support authorized secondary development based on existing application source code.
[0003] In the above scenarios, app stores not only need to determine whether the submitted package can run, but also whether the newly submitted application extensively reuses the source code, structure, or capability design of already released applications, and whether this reuse has been authorized by the original service provider. Without similarity governance mechanisms during the development and release phases, service providers may copy released tools without authorization, or, after obtaining secondary development authorization, be unable to accurately prove their development source and authorization status, leading to source code leaks, duplicate submissions, review disputes, and intellectual property risks.
[0004] Existing source code deduplication or code clone detection solutions are mostly applied to local code repositories, teaching assignments, open-source repositories, or code quality analysis scenarios. Their primary goal is to identify code duplication or similarity, rather than solving source code reuse governance, authorization status determination, and release gating issues in multi-tenant app stores. When such solutions are directly applied to multi-tenant app store development platforms and secondary development management scenarios, they have at least the following shortcomings: (1) Existing solutions are mostly implemented after release or in the manual review stage. They lack a full lifecycle governance mechanism that covers the development process, the submission and release process and the review and processing process. They cannot continuously provide similarity risk warnings during the service provider's development process, nor can they complete automatic interception before submission.
[0005] (2) The existing solution lacks a trusted binding with the identity of the development entity, the identity of the development workspace, the routing token and the authorization relationship. It cannot guarantee the consistency between the similarity detection results and the actual development entity, workspace source and authorization status. It is easily affected by forged requests, cross-tenant misjudgment or inconsistent authorization status.
[0006] (3) Existing solutions often require uploading the complete source code or repeatedly downloading candidate source code packages, resulting in high network transmission volume, object storage access volume, and server decompression calculation volume, which is not suitable for high-frequency incremental scanning scenarios in online development tools.
[0007] (4) Existing solutions typically re-traverse the entire project and all candidate source codes for each scan, failing to fully utilize file change events, incremental profile caching, and pre-indexing of audited source codes, resulting in high scanning latency and difficulty in supporting large-scale real-time governance in multi-tenant application stores.
[0008] (5) Existing solutions mostly output a single similarity score, which is difficult to express the inheritance relationship, source relationship, authorization relationship and version evolution relationship between applications. They cannot distinguish different governance scenarios such as reuse by the same service provider, authorized secondary development, continued development of source application and reuse by unauthorized third parties.
[0009] (6) Existing solutions typically only provide similarity scores or hit results, lacking verifiable and verifiable evidence summaries. They are difficult to explain the specific file structure, source code fingerprint, dependency relationships, interface calls, or capability declarations of the hits, and cannot provide stable evidence for review, intellectual property dispute resolution, and compliance audit.
[0010] (7) Existing solutions mainly focus on code-level duplication detection, lacking a comprehensive analysis mechanism that combines project structure, dependency relationships, interface capabilities, application lineage and authorization relationships, making it difficult to adapt to the complex reuse governance needs in multi-tenant application stores and enterprise-level development platforms.
[0011] Therefore, there is an urgent need for a source code profiling similarity governance authorization gating method for multi-tenant online development tools and app store release processes. Summary of the Invention
[0012] This application provides an authorization gating method and system based on the similarity governance of multi-tenant source code profiles. Its technical purpose is to achieve early warning during development, mandatory gating during release, and evidence retention without frequently uploading complete source code.
[0013] The above-mentioned technical objective of this application is achieved through the following technical solution: An authorization gating method based on multi-tenant source code profile similarity governance includes: Construct and associate trusted identity tuples and application authorization relationship graphs in the current work area; Construct a source code profile of the current workspace based on incremental file change events; Construct an index of source code profiles for the reviewed candidate applications; Based on the index items of the current workspace source code profile and the candidate application source code profile, the candidate applications are recalled and scored in multiple dimensions to obtain the final set of candidate applications; The source code strong evidence determination result is calculated for each candidate application in the final candidate application set; The authorization relationship type of each candidate application in the final candidate application set is determined based on the application authorization relationship graph. Based on the authorization relationship type and the source code strong evidence judgment result, candidate gating decisions are generated for each candidate application in the final candidate application set, and the candidate gating decisions are merged according to the preset decision priority to generate the final gating decision result. Based on the final gating decision result, a verifiable evidence summary is generated, development-phase early warning and release-phase mandatory gating are executed, and the application authorization relationship graph is updated after the release submission is completed.
[0014] Preferably, the construction and association of the trusted workspace identity and application authorization relationship graph of the current workspace includes: Use development tools to create or reuse the current workspace and generate a trusted identity tuple for that workspace, represented as: ; in, This represents the trusted identity tuple in the current work area. Indicates the service provider user identifier. Indicates the current workspace routing identifier. Indicates the user's workspace token. Indicates the container identifier of the current workspace. Indicates the current project identifier. This indicates the application source identifier for the current project. Indicates the time the identity was generated or the time the identity was refreshed; The application licensing relationship graph is constructed as follows: ; Represents the application licensing relationship graph. This represents a collection of application nodes that have been published or are awaiting review. Represents a set of service provider nodes. This represents the set of authorized nodes for secondary development. Indicates ownership relationship of the application. This indicates a secondary development authorization relationship. This indicates the source code import relationship. This indicates the authorization status, approval time, scope of authorization, validity period, and revocation status. Based on the trusted identity tuple of the work area, the current project in the current work area... Application source identifier Check if it is empty; if not, then set the current project... Service Provider User Identifier Corresponding service provider node and application source identifier The relationships between them are used as source relationships to be verified, and are associated with and verified against the application ownership relationships and secondary development authorization relationships in the application authorization relationship graph; after verification, the valid source code is imported into the source relationship. Write the application authorization relationship graph; if the verification fails, mark it as pending review.
[0015] Preferably, the construction of the source code profile of the current workspace based on incremental file change events includes: For local files The image cache table is maintained, and the image cache table is represented as follows: ; in, Representing a path Corresponding local file Image cache table, Represents local files Content hash value, Represents local files Modification timestamp, Represents local files Number of bytes, Represents local files The source code of the token fingerprint collection, Represents local files The set of directory structure path features, Represents local files The set of dependency features involved Represents local files The set of interface call characteristics included. Represents local files The set of capability declaration features involved; Trigger the initial scan and listen for file change events; For the monitored files The file's content hash value, modification timestamp, and number of bytes are read to perform file operations. Content hash value, modification timestamp, and number of bytes compared to local files Image cache table The corresponding items in the file are compared: if any of the content hash value, modification timestamp, and number of bytes changes, then the file is modified accordingly. The corresponding source code token fingerprint set, directory structure path feature set, dependency relationship feature set, interface call feature set, and capability declaration feature set are regenerated, and the newly generated feature set is updated to the profile cache table. The corresponding item in the file; if the content hash value, modification timestamp, and number of bytes have not changed, then the file Directly reuse the image cache table The stored features include a set of source code token fingerprints, a set of directory structure path features, a set of dependency relationship features, a set of API call features, and a set of capability declaration features; among these, Indicates the first The current file that needs to generate a source code profile; The feature sets of newly created or modified files during this scan are compared with those of unchanged files in the image cache table. The historical feature sets in the current workspace are merged, and cache entries and feature sets corresponding to deleted files are removed. Simultaneously, the file change set and feature change set relative to the last scan are recorded, forming an incremental source code profile of the current workspace that covers all existing files in the current workspace, represented as: ; in, This represents the current working area source code profile after the increment. This represents the set of source code token fingerprints for all files in the current working directory. This represents the set of directory structure path features for all files in the current workspace. This represents the set of dependency features for all files in the current workspace. This represents the set of interface call characteristics for all files in the current workspace. This represents the set of capability declaration features for all files in the current workspace. This represents a lightweight digest generated from a set of source code token fingerprints. This represents the set of file changes and feature changes in this scan compared to the previous scan.
[0016] Preferably, the construction of the index items for the source code profile of the reviewed candidate applications includes: The timing and triggering method for generating candidate application source code profiles are determined. Generate source code profiles for the source code packages of the approved candidate applications; The generated candidate application source code profiles are organized into index items and written to the index store. These index items are represented as follows: ; in, Indicates candidate applications The index item of the source code portrait, The application identifier representing the candidate application. This indicates the owner / service provider identifier of the candidate application. This indicates the version number of the candidate application's source code package. This represents the set of source code token fingerprints for candidate applications. This represents the set of directory structure path features for candidate applications. This represents the set of dependency features for candidate applications. This represents the set of API call characteristics for candidate applications. This represents the set of capability declaration features for candidate applications. This represents a lightweight digest generated from the set of source code token fingerprints of the candidate application. This represents the source code profile quality factor.
[0017] Preferably, the step of recalling and multi-dimensionally scoring candidate applications to obtain the final candidate application set includes: Phase 1 Recall: Retrieving lightweight digests from the current workspace's source code profile. As a query vector, the current workspace source code profile is compared with the lightweight summary corresponding to all data in the candidate application source code profile. When a candidate application meets the corresponding recall threshold in at least one dimension, the candidate application is included in the candidate application set. Then the candidate application set Should meet: ; in, Lightweight summary With lightweight summary Similarity; , , , This represents the lightweight summary similarity between the current workspace source code profile and the candidate application source code profile, which includes the set of directory structure path features, dependency relationship features, interface call features, and capability declaration features. , , , , These are the recall thresholds for each dimension; Phase Two: Multi-Dimensional Scoring; Profiling the Source Code of the Current Workspace and the Set of Candidate Applications The comprehensive similarity score of the source code profile of each candidate application is calculated and expressed as follows: ; in, This represents the overall similarity score between the current workspace's source code profile after incremental updates and the candidate application's source code profile. The Jaccard similarity of the source code token fingerprint set between the current workspace source code profile and the candidate application source code profile after incremental modification is represented. The Jaccard similarity of the directory structure path feature set between the current workspace's incremental source code profile and the candidate application source code profile. This indicates the similarity of the dependency feature set between the current workspace's incremental source code profile and the candidate application's source code profile. This represents the Jaccard similarity of the set of interface call features between the current workspace source code profile and the candidate application source code profile after incremental updates. The Jaccard similarity of the capability declaration feature set between the current workspace incremental source code profile and the candidate application source code profile; This indicates the semantic similarity of metadata between the current workspace's incremental source code profile and the candidate application's source code profile. , , , , and These represent the weight coefficients for each dimension, and ; Candidate application set The candidate applications are sorted from highest to lowest based on their overall similarity score, and the top N candidate applications with the highest overall similarity scores are retained to form the final candidate application set; where, if the candidate application set... If the value is empty, then all candidate applications are directly determined to have no similar risks.
[0018] Preferably, the calculation of the source code strong evidence determination result for each candidate application in the final candidate application set includes: When a candidate application meets When the candidate application's source code is deemed strong evidence, the result of the assessment will be as follows: True; When a candidate application does not meet the requirements When the source code of the candidate application is used as strong evidence, the result of the assessment is as follows: Not true; in, This indicates the result of the strong evidence assessment based on the source code. This represents the threshold for source code token fingerprint similarity. Indicates the minimum number of fingerprints that must be matched; This represents the number of identical fingerprints matched in the source code token fingerprint sets of the current workspace source code profile and the candidate application source code profile. This indicates the path distribution degree of files involving the same fingerprint in candidate applications; This represents the path distribution threshold.
[0019] Preferably, the authorization relationship type of each candidate application in the final candidate application set is determined according to the application authorization relationship graph, including: The authorization relationship function for each candidate application in the final candidate application set is constructed as follows: ; in, This indicates the type of authorization relationship between the current workspace and the candidate application. This indicates the candidate application The owner; The authorization relationship type of the candidate application is determined based on the authorization relationship function according to the priority order, which is: Decision 1 > Decision 2 > Decision 3 > Decision 4 > Decision 5, specifically including: Judgment 1: If This means that the service provider in the current workspace and the owner of the candidate application are the same service provider, and the authorization relationship type of the candidate application is "same service provider reuse"; if Proceed to Decision 2; Judgment 2: If Not empty, and If the application source identifier of the current project is equal to the application identifier of the candidate application, then the application source identifier of the current project is... With service provider user identifier Between the application licensing relationship graph Does the source code import relationship exist? Perform verification; if so, the authorization relationship type of the candidate application is "source application continuation"; otherwise, proceed to decision 3. Judgment 3: In the application authorization relationship graph The current service provider's user identifier Is there a secondary development licensing relationship between this candidate application and the application? If the secondary development authorization relationship exists, the authorization relationship type of the candidate application is "authorized secondary development" only if the "authorization status is approved, the current time is within the authorization validity period, and the revocation status is not revoked". Otherwise, proceed to decision 4. Judgment 4: If the source code profile quality factor of the candidate application... If the quality is below the preset quality threshold, or if the candidate application is marked as "source code profile unavailable", then the authorization relationship type of the candidate application is "candidate application source code profile unavailable"; otherwise, proceed to decision 5. Decision 5: If the candidate application does not meet any of the conditions in Decisions 1 to 4, then the authorization relationship type of the candidate application is "unauthorized third-party reuse".
[0020] Preferably, the generation of the final gating decision result includes: Judgment 1: For each candidate application in the final candidate application set, based on its authorization relationship type and comprehensive similarity score... The source code strong evidence judgment result and the source code profile quality factor call the gating decision function to obtain the candidate gating decision for the candidate application; wherein, the candidate gating decision includes blocking release decision, manual review decision, development period early warning decision, legal reuse decision, and pass decision. When the source code profile quality factor of the candidate application is lower than the preset quality threshold, or the candidate application is marked as "source code profile unavailable", then the candidate gating decision for the candidate application is determined to be the manual review decision. The candidate gating decisions for each application are merged according to the following priority order: blocking release decision > manual review decision > development period early warning decision > legal reuse decision. The candidate gating decision with the highest priority is the final gating decision result of the final candidate application set. When there are multiple candidate applications with the same highest priority, a comprehensive similarity score will be used. The highest-ranking candidate application is determined as the primary candidate application, and the candidate gating decision corresponding to the primary candidate application is the final gating decision result of the final candidate application set. The gating decision function is expressed as follows: ; in, Represents the gating decision function. Indicates the type of authorization relationship. Indicates the type of authorization relationship The corresponding warning threshold, Indicates the type of authorization relationship The corresponding blocking threshold; The judgment 1 specifically includes: Judgment 1.1: When the authorization relationship type of the candidate application When the criteria are "reuse with the same service provider," "continuation of the source application," or "authorized secondary development," a valid reuse decision is generated, and when... ≥ At that time, only prompts or authorization scope confirmation information are generated, and the authorization relationship type is written into the evidence digest; Judgment 1.2: When the source code of the candidate application provides strong evidence, the judgment result is... If true, and the authorization relationship type is... When the issue is "unauthorized third-party reuse", a decision to block the release will be generated directly. Judgment 1.3: When the source code of the candidate application provides strong evidence, the judgment result is... The condition is not true, the authorization relationship type is "unauthorized third-party reuse", the corresponding blocking threshold is enabled, and ≥ , Then a decision to block the release is generated; Judgment 1.4: When the conditions for legal reuse, manual review, and blocking of publication are all not met, if ≥ and , Then, a development phase early warning decision is generated; if < And the source code is strong evidence for the judgment result. If it is not true, then the decision is passed.
[0021] Preferably, the step of generating a verifiable evidence summary based on the final gating decision result, executing development-phase early warning and release-phase mandatory gating, and updating the application authorization relationship graph includes: The scan identifier, trusted identity tuple, the candidate application identifier that was hit, the comprehensive similarity score and sub-scores of each dimension, the source code fingerprint digest that was hit, the path digest that was hit, the authorization relationship type, the warning threshold, the blocking threshold, the source code strong evidence judgment result, and the final gating decision result are written into the verifiable evidence digest. During development scanning, when the final gating decision is a development warning decision, the matching application, similarity score, and suggested actions will be returned to the development tool for prompting, and development will be allowed to continue. During the release submission phase, a forced scan is performed before the application package and source code package enter the storage and review process; when the final gating decision is to block the release, a conflict result is returned and the release submission is blocked; when the final gating decision is to pass or legal reuse, entry into the storage and review process is allowed; when the final gating decision is to conduct a manual review, the process is transferred to the manual review process. After the release submission is completed, if the authorization relationship type is source application continuation or authorized secondary development, the valid source code import source relationship is recorded and the application authorization relationship graph is updated; if the authorization relationship type is reuse within the same service provider, the version evolution relationship is recorded; if the final gating decision result is a release blocking decision, no new authorization relationship is added and the blocking audit information is recorded.
[0022] An authorization gating system based on multi-tenant source code profile similarity governance, wherein the authorization gating system is used to implement any of the authorization gating methods described above, and the authorization gating system includes: The building module is used to construct and associate trusted identity tuples and application authorization relationship graphs in the current workspace; The incremental source code profiling module is used to build a source code profile of the current workspace based on file change events. The candidate profile index module is used to construct index items for the profiles of the source code of the reviewed candidate applications; The recall and scoring module is used to recall and score candidate applications in multiple dimensions based on the index items of the current workspace source code profile and the candidate application source code profile, so as to obtain the final set of candidate applications. The strong evidence calculation module is used to calculate the source code strong evidence determination result for each candidate application in the final candidate application set. The authorization relationship type calculation module is used to determine the authorization relationship type of each candidate application in the final candidate application set based on the application authorization relationship graph; The gating decision generation module is used to generate candidate gating decisions for each candidate application in the final candidate application set based on the authorization relationship type and the source code strong evidence judgment result, and to merge the candidate gating decisions according to the preset decision priority to generate the final gating decision result. The gating execution module is used to generate a verifiable evidence summary based on the final gating decision result, perform early warning during development and mandatory gating during release, and update the application authorization relationship graph after release submission.
[0023] The above technical solution can achieve at least some of the following technical effects: (1) This application incorporates service provider identity, development tool routing, workspace token, source application and secondary development authorization into the same governance process, avoiding cross-tenant misjudgment and forged scanning requests caused by simply relying on client declaration or single user identity. It can accurately distinguish between reuse by the same service provider, authorized secondary development and unauthorized third-party reuse, and dynamically adjust the warning threshold and blocking threshold according to the type of authorization relationship.
[0024] (2) This application performs scanning after short delay and work area change, and no longer relies on fixed periodic scanning; by recalculating only changed files through file content hashing and image caching, the overhead of disk reading, word segmentation hashing and network request during development period scanning is significantly reduced.
[0025] (3) This application pre-generates a candidate application source code profile when the application is approved or the source code package is updated. During scanning, a lightweight digest is used to recall high-risk candidates first, and then a precise score is performed to avoid repeatedly downloading, decompressing and parsing all candidate application source code packages for each scan, thereby improving the response capability of the application store in large-scale scenarios.
[0026] (4) This application not only compares source code text fragments, but also directory structure, dependencies, interface paths and plugin capability declarations. It can identify complex reuse methods such as renaming, shell replacement, file moving and metadata circumvention, and improve the recall capability and audit interpretability of unauthorized reuse. At the same time, through the source code strong evidence threshold, it can still trigger blocking even if the metadata is modified.
[0027] (5) This application helps service providers to identify similar risks in a timely manner during the development stage, blocks unauthorized highly similar applications from entering the storage and review process during the release and submission stage, and supports subsequent manual review, dispute resolution and compliance audit through evidence summaries.
[0028] In summary, this application combines trusted workspace identity, incremental source code profiling, candidate profiling index, two-stage similarity recall, authorization relationship determination, and pre-release interception to achieve early warning during development, mandatory gating during release, and evidence retention without frequently uploading complete source code. Attached Figure Description
[0029] Figure 1 This is a flowchart of the authorization gating method based on multi-tenant source code profile similarity governance in the embodiments of this application; Figure 2 This is a schematic diagram of the dual-gating process of development-phase scanning and pre-release blocking in the embodiments of this application. Detailed Implementation
[0030] The technical solution of this application will be described in detail below with reference to the accompanying drawings.
[0031] like Figure 1 As shown, the authorization gating method based on multi-tenant source code profile similarity governance described in this application includes: Step 1: Construct and associate the trusted identity tuples and application authorization relationship graph of the current work area.
[0032] When a service provider enters the development tool, the app store backend verifies the service provider's status. Upon successful verification, the development tool scheduler creates or reuses isolated workspace containers. The development tool scheduler generates a workspace route identifier, a user workspace token, a workspace container name, and an upstream address for each workspace, and writes this information to the database and route cache. After the workspace container starts, it only holds the server-side internal token, service provider user identifier, workspace route identifier, and user workspace token corresponding to the current service provider. Here, "service provider" refers to the tenant development entity in the platform; the "service provider user identifier" uniquely identifies the tenant development entity; and the "user workspace token" is the access token for that workspace.
[0033] In an exemplary embodiment, the construction and association of the trusted workspace identity and application authorization relationship graph of the current workspace includes: Step 11: Use development tools to create or reuse the current workspace and generate a trusted identity tuple for that workspace, represented as: ; in, This represents the trusted identity tuple in the current work area. Indicates the service provider user identifier. Indicates the current workspace routing identifier. Indicates the user's workspace token. Indicates the container identifier of the current workspace. Indicates the current project identifier. This indicates the application source identifier for the current project (filled in when creating from a template or importing from the cloud). This indicates the time the identity was generated or the time the identity was refreshed.
[0034] Specifically, when the server receives a similarity scan request, it simultaneously verifies the server's internal token and the service provider's user identifier. Current work area routing identifier and user workspace token Only when the above fields match the workspace records in the database will the similarity management process be allowed, and only then will the records that pass the verification be allowed to proceed. , , Current project identifier and application source identification This serves as the trusted identity input for the authorization relationship graph query in step 12 and subsequent gating decisions. Furthermore, the scope of the current request's target operation is limited to applications under this service provider's name or those with authorized access; cross-tenant scanning is prohibited.
[0035] Step 12: Construct the application licensing relationship graph to represent the relationships between published applications, service providers, secondary development applications, licensing status, and sources, as shown below: ; in, Represents the application licensing relationship graph. This represents a collection of application nodes that have been published or are awaiting review. Represents a set of service provider nodes. This represents the set of authorized nodes for secondary development. Indicates ownership relationship of the application. This indicates a secondary development authorization relationship. This indicates the source code import relationship. This diagram represents the authorization status, approval time, scope of authorization, validity period, and revocation status. This authorization relationship diagram is used for subsequent dynamic threshold selection and gating result determination.
[0036] The graph is constructed as follows: it is loaded from the database upon first use, and subsequently updated incrementally by listening for events such as authorization approval, authorization expiration, and authorization revocation to ensure that the authorization information used for gating decisions is in real-time. If an expired or revoked authorization edge of a candidate application is found during scanning, it is determined that there is no valid authorization.
[0037] Step 13: Based on the trusted identity tuple of the workspace, perform an analysis of the current project in the current workspace. Application source identifier Check if it is empty; if not, then set the current project... Service Provider User Identifier Corresponding service provider node and application source identifier The relationships between them are used as source relationships to be verified, and are associated with and verified against the application ownership relationships and secondary development authorization relationships in the application authorization relationship graph; after verification, the valid source code is imported into the source relationship. Write the application authorization relationship graph; if the verification fails, mark it as pending review.
[0038] In one exemplary embodiment, the association verification with the application ownership relationship and secondary development authorization relationship in the application authorization relationship graph includes: verifying the service provider user identifier of the current workspace. and application source identifier Does a valid authorization relationship exist in the authorization relationship graph? edge or If no valid association exists and there is a high risk of similarity, the service provider will be flagged in advance and prompted to supplement the source statement or apply for authorization. The high risk of similarity refers to the current project's lightweight summary pre-detection meeting any recall threshold, or the overall similarity to a released application reaching a warning threshold in the most recent development scan. .
[0039] Step 2: Construct a source code profile of the current workspace based on incremental file change events.
[0040] In one exemplary embodiment, the construction of the current workspace source code profile based on incremental file change events includes: Step 21: For local files The image cache table is maintained, and the image cache table is represented as follows: ; in, Representing a path Corresponding local file Image cache table, Represents local files Content hash value, Represents local files Modification timestamp, Represents local files Number of bytes, Represents local files The source code of the token fingerprint collection, Represents local files The set of directory structure path features, Represents local files The set of dependency features involved Represents local files The set of interface call characteristics included. Represents local files The set of capability declaration features involved.
[0041] Step 22: Trigger the first scan and listen for file change events.
[0042] In an exemplary embodiment, after the development tool starts, an initial source code profile scan is performed after a preset short startup delay window (e.g., 500 milliseconds). File change events occurring within this startup delay window are also included in the initial scan. When file saving, creation, renaming, uploading, deletion, template creation, cloud source code import, or intelligent programming modification events occur, change events within a preset debouncing time window (e.g., 30 seconds) are merged. That is, when multiple consecutive change events occur within the debouncing time window, they are merged into a single scan task, and the actual scan is triggered only after the window ends, avoiding resource waste caused by frequent scanning. The system does not rely on fixed-cycle scanning, thereby avoiding repeated directory readings and server requests when the project remains unchanged.
[0043] Step 23: Monitor the detected files The file's content hash value, modification timestamp, and number of bytes are read to perform file operations. Content hash value, modification timestamp, and number of bytes compared to local files Image cache table The corresponding items in the file are compared: if any of the content hash value, modification timestamp, and number of bytes changes, then the file is modified accordingly. The corresponding source code token fingerprint set, directory structure path feature set, dependency relationship feature set, interface call feature set, and capability declaration feature set are regenerated, and the newly generated feature set is updated to the profile cache table. The corresponding item in the file; if the content hash value, modification timestamp, and number of bytes have not changed, then the file Directly reuse the image cache table The stored features include a set of source code token fingerprints, a set of directory structure path features, a set of dependency relationship features, a set of API call features, and a set of capability declaration features; among these, Indicates the first The current file that needs to generate a source code profile.
[0044] Through the above-mentioned cache reuse mechanism, computationally intensive token fingerprint generation and multi-dimensional feature extraction operations are only performed on files that have been changed, while historical profiles are directly reused for files that have not been changed, which significantly reduces the overhead of disk reads, word segmentation hash calculations and feature extraction during frequent scanning during the development period.
[0045] In one exemplary embodiment, when the file When changes occur, for the changed documents The system first standardizes the case of the source code text (for case-insensitive languages), filters out comment interference items and comment blocks, and filters excessively large text files (such as files exceeding the preset size threshold of 10MB, which skip fingerprint generation to avoid performance degradation). Then, it segments the text by identifiers, numbers, and key syntax symbols to generate a token sequence.
[0046] The source code fragment fingerprint is generated based on k consecutive tokens. Specifically, for each fragment consisting of k consecutive tokens in the token sequence, an irreversible hash function is applied to calculate the hash value of that fragment. This hash value is then used as the source code fragment fingerprint. The entire token sequence is then traversed to obtain the modified file. The source code token fingerprint set is represented as: ; in, For the change of documents The source code of the token fingerprint collection; For the standardized first One token; This refers to the size of the fragment window; It is an irreversible hash function; For the change of documents The total length of the token sequence.
[0047] As an exemplary embodiment, the generated source code token fingerprint set is truncated (e.g., only the lower 32 bits of the hash value are retained) to reduce storage overhead, and deduplication is performed to obtain the final source code token fingerprint set.
[0048] In addition to the source code token fingerprint set, the following features are extracted to enhance the ability to identify variable renaming, file moving, and template reuse: (1) Directory structure path feature extraction: Obtain the normalized path of the file in the project (relative path relative to the project root directory), split the path into a sequence of path segments according to the directory separator, and form a set of structural path features. In cases where files have been moved or renamed, path characteristics can help determine the correspondence between files.
[0049] (2) Dependency feature extraction: Parse the project's dependency declaration files (such as package.json, go.mod, requirements.txt, etc.), extract the names of direct dependent packages, version constraints, and transitive dependency graphs to form a dependency feature set. Dependency features can identify project relationships through dependencies even when the source code text has low similarity.
[0050] (3) Interface call feature extraction: parse the interface definitions (such as API route definitions, RPC method declarations, function export declarations) and interface call points (such as HTTP request paths initiated by the front end and inter-service call interfaces) in the modified source code file, extract the interface path patterns and call relationships, and form an interface call feature set.
[0051] (4) Capability declaration feature extraction: When the changed file belongs to the plugin project or hits the capability declaration file, parse the capability declaration file of the corresponding plugin or application (such as manifest.json, plugin.xml, capability configuration file), extract the capability items, permission requests, extension point registration and key resource entry points declared by the plugin, and form a set of capability declaration features.
[0052] Step 24: Compare the feature sets of newly created or modified files with those of unchanged files in the image cache table. The historical feature sets in the current workspace are merged, and cache entries and feature sets corresponding to deleted files are removed. Simultaneously, the file change set and feature change set relative to the last scan are recorded, forming an incremental source code profile of the current workspace that covers all existing files in the current workspace, represented as: ; in, This represents the current working area source code profile after the increment. This represents the set of source code token fingerprints for all files in the current working directory. This represents the set of directory structure path features for all files in the current workspace. This represents the set of dependency features for all files in the current workspace. This represents the set of interface call characteristics for all files in the current workspace. This represents the set of capability declaration features for all files in the current workspace. This represents a lightweight digest generated from a set of source code token fingerprints. This represents the set of file changes and feature changes in this scan compared to the previous scan.
[0053] Step 3: Construct the index items for the source code profiles of the reviewed candidate applications.
[0054] In one exemplary embodiment, constructing the index items for the profile of the reviewed candidate application source code includes: Step 31: Determine the timing and triggering method for generating the candidate application source code profile.
[0055] In this application, candidate applications refer to existing applications that have been released or reviewed and can be used as similarity comparison objects, excluding applications currently under development or awaiting submission in the current workspace. The pre-generation or refresh of candidate application source code profiles will be triggered under the following circumstances: (1) When a candidate application passes the review for the first time, the source code profile of the candidate application will be generated immediately after the review pass event is triggered; (2) When the source code package of a candidate application that has been released is updated (such as version upgrade or patch fix), the source code profile will be regenerated after the update is submitted and approved. (3) When the authorization status of a candidate application changes (such as the addition of an authorization relationship, the expiration of authorization, or the revocation of authorization), the authorization-related markers in the source code profile of the candidate application are refreshed; (4) The background asynchronous refresh task regenerates the candidate application source code portrait with a low portrait quality factor according to a preset period (such as early morning every day) to correct possible parsing failures or incomplete portrait problems.
[0056] In one implementation, the source code profile generation when the application is approved is done synchronously, that is, the source code profile is generated before the approval response is returned, ensuring that the source code profile can be used immediately for similarity scanning in the subsequent development phase after the release; the source code profile refresh when the source code package is updated and the authorization status changes is done asynchronously, and is added to the background task queue for execution to avoid blocking the main process response.
[0057] Step 32: Generate source code profiles for the source code packages of the approved candidate applications.
[0058] Specifically, for candidate application source code packages that require source code profiling, the download address of the source code package is obtained from object storage and downloaded to the local index service. After decompression, all source code files in the source code package are traversed, and the following source code profiling features for each file are generated one by one according to the source code token fingerprint generation method and multi-dimensional feature extraction method described in steps 21 and 23: (1) Source code token fingerprint set : Generate fingerprints based on k consecutive tokens, unify capitalization, filter comments, and filter excessively large files; (2) Directory structure path feature set : The normalized path of each file in the decompressed directory structure; (3) Dependency feature set : Parse dependency declaration files and build a dependency graph; (4) Interface call feature set : Parse the interface definition and call point; (5) Set of capability declaration features : Parse capability declaration files such as manifest.json or plugin.xml; (6) Lightweight summary : A collection of source code token fingerprints The generated MinHash digest.
[0059] Aggregate the above features of all files (take the union, construct the overall dependency graph, and summarize capability declarations) to form a complete source code profile of the candidate application. After generating the source code profile, delete the locally extracted source code package copy to free up storage space.
[0060] If the candidate application's source code package fails during download, decompression, or parsing (e.g., the source code package is corrupted, decompression times out, or critical dependency declaration files are missing), the candidate application's profile quality factor will be lowered. Mark it as unavailable and record the reason for failure so that subsequent asynchronous refresh tasks can retry.
[0061] Step 33: Organize the generated candidate application source code profiles into index items and write them into the index store. These index items are represented as follows: ; in, Indicates candidate applications The index item of the source code portrait, The application identifier representing the candidate application. This indicates the owner / service provider identifier of the candidate application. This indicates the version number of the candidate application's source code package. This represents the set of source code token fingerprints for candidate applications. This represents the set of directory structure path features for candidate applications. This represents the set of dependency features for candidate applications. This represents the set of API call characteristics for candidate applications. This represents the set of capability declaration features for candidate applications. This represents a lightweight digest generated from the set of source code token fingerprints of the candidate application. This represents the source code profile quality factor.
[0062] In one exemplary embodiment, Values range from 0 to 1, with an initial default value of 1.0. These values represent the completeness of the source code package, the proportion of parseable files, the number of skipped files, and the profile update time. When unparseable files exist in the source code package, the value is reduced proportionally to the number of parseable files out of the total number of files. Value; when the time for generating the source code profile exceeds a preset threshold (e.g., 30 days) and the application has not been updated during this period, the value gradually decreases. The value indicates that the source code profile may be outdated; when If the value is below a preset threshold (e.g., 0.5), the candidate application source code profile will have its participation weight reduced in the first stage of recall in step 4, or will be transferred to manual review in the gating decision.
[0063] The aforementioned index entries are written to a database, object storage, or a dedicated indexing service. In one implementation, the index storage uses a key-value pair structure, identified by the application. and source code package version number Using the combination of [key] and the features of each dimension of the source code profile as values, it supports precise reading by application identifier in subsequent step 4, and also supports reading by [other criteria]. Perform vector similarity retrieval (e.g., using the LSH index of MinHash).
[0064] For different versions of source code profiles of the same candidate application, in one implementation, only the complete source code profile of the latest version is retained, while historical versions are only retained as source code profiles. The summary is used for tracing and comparison to control index storage space; in another implementation, all historical version source code profiles are retained to support the determination of source code evolution differences between the current version and historical versions when releasing and committing.
[0065] In one exemplary embodiment, maintaining the lifecycle and consistency of candidate application source code profiles includes: (1) When an application that has been published is removed from the app store, the source code profile corresponding to the application is marked as removed from the app store. During the first phase of the recall, the source code profile of the removed application is skipped.
[0066] (2) When the source code package of the published application is updated and the new source code profile is successfully generated, the old version source code profile is marked as the historical version and the new version source code profile is marked as the current version. Subsequent scans will use the current version source code profile for comparison by default. If it is necessary to trace a specific version, the source code package version number stored in the index can be used. Search using the fields specified.
[0067] (3) When the candidate application source code profile quality factor If the quality falls below the preset quality threshold, the source code profile is marked as pending a refresh. The source code package is then downloaded again and the source code profile is regenerated in the background asynchronous refresh task. If multiple refreshes fail and the candidate source code package cannot be parsed, the candidate application is marked as "source code profile unavailable" and its participation weight is reduced in the governance results or transferred to manual review.
[0068] Step 4: Based on the index items of the current workspace source code profile and the candidate application source code profile, recall and score the candidate applications in multiple dimensions to obtain the final candidate application set.
[0069] In one exemplary embodiment, the recall and multi-dimensional scoring of candidate applications to obtain a final set of candidate applications includes: Step 41: First-stage recall: Retrieve lightweight summaries from the current working directory's source code profile. As a query vector, the current workspace source code profile is compared with the lightweight summary corresponding to all data in the candidate application source code profile. When a candidate application meets the corresponding recall threshold in at least one dimension, the candidate application is included in the candidate application set. Then the candidate application set Should meet: ; in, Lightweight summary With lightweight summary Similarity; , , , This represents the lightweight summary similarity between the current workspace source code profile and the candidate application source code profile, which includes the set of directory structure path features, dependency relationship features, interface call features, and capability declaration features. , , , , These are the recall thresholds for each dimension, and each recall threshold can be dynamically adjusted based on the size of the candidate application source code profile index and the server load.
[0070] The first phase is used to narrow down the candidate space and reduce the computational overhead of the server performing accurate comparisons on a large number of published applications.
[0071] In one implementation, the lightweight summaries corresponding to each of the above dimensions are pre-calculated and stored when the candidate application source code profile index is generated in step 3. During the first-stage recall, only the pre-calculated summary values are read for comparison, without needing to access the complete source code profile data, thereby further reducing computational overhead.
[0072] During the first phase of the recall, the following candidate applications were skipped to reduce invalid comparisons: (1) Source code profile quality factor Candidate applications with a quality score below a preset threshold (e.g., 0.5) may have incomplete source code profiles, resulting in unreliable recall results. (2) Candidate applications that have been marked as removed from the app store; (3) User ID of the current work area service provider For candidate applications that are identical and reused by the same service provider, in one implementation, their recall threshold can be appropriately increased to reduce unnecessary precise scoring calculations.
[0073] The first phase of recall outputs a deduplicated set of candidate applications. The candidate application set The size is much smaller than the total number of all released applications, thus significantly narrowing the scope of subsequent accurate scoring calculations.
[0074] Step 42: Second-stage multi-dimensional scoring: Profiling the source code of the current workspace and the set of candidate applications. The comprehensive similarity score of the source code profile of each candidate application is calculated and expressed as follows: ; in, This represents the overall similarity score between the current workspace's incremental source code profile and the candidate application's source code profile. This represents the Jaccard similarity between the source code token fingerprint sets of the current workspace incremental source code profile and the candidate application source code profile. It is calculated by dividing the intersection size of the two source code token fingerprint sets by the union size. This dimension reflects the degree of reusability at the source code text level and is the most critical indicator in governance decisions.
[0075] This represents the Jaccard similarity of the directory structure path feature set of the current workspace incremental source code profile and the candidate application source code profile, comparing the degree of overlap in the directory structure of the two projects; this dimension can identify structural reuse through file renaming or directory reorganization.
[0076] This represents the similarity of the dependency feature sets between the current workspace's incremental source code profile and the candidate application's source code profile. The calculation method is as follows: extract the direct dependency package name list and indirect dependency package list of the two projects respectively, calculate the proportion of the number of common dependency packages to the union of the number of dependency packages in the two projects, and calculate the version compatibility ratio at the dependency package version constraint level. The two are then weighted and merged to obtain the G value. This dimension can identify reuse by modifying the source code but retaining the same dependency structure.
[0077] This represents the Jaccard similarity of the interface call feature set between the current workspace incremental source code profile and the candidate application source code profile, comparing the degree of overlap in the interface path patterns exposed or called by the two projects; this dimension can identify reuse by retaining the same API design but reimplementing the internal logic.
[0078] This represents the Jaccard similarity of the feature sets of capability declarations between the current workspace's incremental source code profile and the candidate application's source code profile, comparing the degree of overlap in the capability items, permissions, and extension points declared by the two projects; this dimension can identify capability-level reuse in plug-in development scenarios.
[0079] This represents the metadata semantic similarity between the current workspace incremental source code profile and the candidate application source code profile. It calculates the text semantic similarity between the two projects in metadata fields such as application name, description text, and category tags. In one implementation, a pre-trained word vector model is used to encode the metadata text into vectors, and the cosine similarity between the two vectors is calculated as the M value. This dimension serves as an auxiliary indicator to identify behaviors that evade detection by modifying metadata. When the source code level similarity is high while the metadata similarity is low, the source code strong evidence determination in step 5 is triggered.
[0080] , , , , and These represent the weight coefficients for each dimension, and The values of each weighting coefficient can be dynamically adjusted according to the following rules: (1) For source code intensive projects (such as backend services and core algorithm libraries). (Source code fingerprint weight) has a relatively high value, ranging from 0.50 to 0.70; (2) For configuration-intensive projects (such as plugins, microservice configuration packages), (Path weight) (Ability weight) takes a higher value. It can be appropriately reduced to 0.30-0.45; (3) For API gateway or service orchestration projects, (depending on weight) (Interface weight) takes a higher value; (4) In one implementation, the system automatically selects the corresponding preset weight combination based on the project type detected in step 2 (identified by flag files such as package.json, go.mod, manifest.json, etc.); (5) In another implementation, the system bases its decisions on a set of candidate applications. Dynamically adjust the weights of each dimension: When the number of candidate applications is large, appropriately reduce the auxiliary dimensions (such as...). Metadata weighting can reduce false positives. When the number of candidate applications is small, auxiliary dimensions can be appropriately increased to improve recall sufficiency.
[0081] Step 43: Set up the candidate application set The candidate applications are sorted from highest to lowest based on their overall similarity score, and the top N candidate applications with the highest overall similarity scores are retained to form the final candidate application set. Among them, if the candidate application set If the value is empty, then all candidate applications are directly determined to have no similar risks.
[0082] Step 5: Calculate the source code strong evidence determination result for each candidate application in the final candidate application set.
[0083] In one implementation, the final candidate application set is evaluated during the precise scoring process. Each candidate application in the process undergoes a synchronous strong source code evidence assessment. The strong source code evidence rule is designed to counter behaviors that attempt to circumvent governance detection by modifying metadata such as application name, summary, and category tags to lower the overall similarity score. When the source code token fingerprint similarity, the number of matched fingerprints, and the distribution of matched files between the current workspace and a candidate application simultaneously meet preset conditions, the overall similarity score of the candidate application is not simply increased; instead, a new strong source code evidence is generated during the gating decision process. The strong evidence flag allows the candidate application to enter the mandatory governance determination.
[0084] In an exemplary embodiment, the source code strong evidence determination result for each candidate application in the final candidate application set is calculated, including: Step 51: When a candidate application meets the following conditions... When the source code of the candidate application is used as strong evidence, the result of the assessment is as follows: It is true.
[0085] Step 52: When a candidate application does not meet the requirements When the source code of the candidate application is used as strong evidence, the result of the assessment is as follows: It is not true.
[0086] in, This indicates the result of the strong evidence assessment based on the source code. This represents the threshold for source code token fingerprint similarity. Indicates the minimum number of fingerprints that must be matched; This represents the number of identical fingerprints matched in the source code token fingerprint sets of the current workspace source code profile and the candidate application source code profile. This indicates the path distribution degree of files involving the same fingerprint in candidate applications; This represents the path distribution threshold.
[0087] The meanings and calculation methods of each judgment condition are as follows: (1) The Jaccard similarity of the source code token fingerprint set reaches the preset source code similarity threshold. (e.g., 0.60) indicates that the two projects have a large number of identical or similar code snippets at the source code text level. (2) The number of identical fingerprints matched between the current workspace and candidate applications has reached a preset minimum threshold. (e.g., 500) This condition is used to exclude misjudgments caused by projects that are too small or by accidental similarity.
[0088] (3) ≥ A hit fingerprint refers to the set of token fingerprints in the current working directory's source code. With candidate application source code token fingerprint set The same fingerprint in the intersection; the path distribution degree of the file involved in the hit fingerprint in the candidate application reaches the preset path distribution threshold. Path distribution degree The calculation method is as follows: count the file paths of all hit fingerprints in the candidate application source code package, calculate the proportion of the number of files covered by the hit fingerprints to the total number of files in the candidate application, and the directory level depth covered by the hit fingerprints; when the hit fingerprints are widely distributed across multiple directory levels and the proportion of the number of files covered exceeds a preset threshold, it indicates that the source code reuse behavior is global rather than local and accidental in the project structure.
[0089] When all three conditions above are met, If the result is true, it indicates that there is strong evidence reuse at the source code level between the current workspace and the candidate application. This flag has mandatory force in the gating decision in step 6—even if the overall similarity score is calculated. Due to metadata similarity Even if the threshold is lowered and pulled below the blocking threshold, the system will still act accordingly. To ensure the effective implementation of the decision to block the release of information.
[0090] In one implementation, to facilitate subsequent review by auditors of the criteria for determining strong evidence in the source code, the following intermediate data is recorded during the determination process: the top 10 file paths with the highest fingerprint density in candidate applications, the histogram of the distribution of fingerprints at each directory level, and a list of candidate files that were not matched but have similar structures. This data serves as an evidence summary. This is part of what is available for later reference.
[0091] Step 6: Determine the authorization relationship type of each candidate application in the final candidate application set based on the application authorization relationship graph.
[0092] In this application, the authorization relationship type The determination is based on the following three data sources: 1) Candidate application owner service provider identifier and the service provider user identifier in the current work area Determine whether the two are the same; 2) Application source identifier for the current work area project Determines whether the current project in the current workspace was imported from or derived from an existing application; 3) Application Licensing Relationship Graph : query and Does a valid authorized edge exist between them? and query and Is there a source edge between them? .
[0093] In an exemplary embodiment, determining the authorization relationship type of each candidate application in the final candidate application set based on the application authorization relationship graph includes: Step 61: Construct the authorization relationship function for each candidate application in the final candidate application set, expressed as: ; in, This indicates the type of authorization relationship between the current workspace and the candidate application. This indicates the candidate application The owner.
[0094] Step 62: Determine the authorization relationship type of the candidate application based on the authorization relationship function according to the priority order, where the priority order is Decision 1 > Decision 2 > Decision 3 > Decision 4 > Decision 5, specifically including: Judgment 1: If This means that the service provider in the current workspace and the owner of the candidate application are the same service provider, and the authorization relationship type of the candidate application is "same service provider reuse"; if Proceed to Decision 2. This authorization relationship type indicates that the service provider is conducting iterative development or version upgrades based on its own released application, which is a normal evolution of its own assets and does not require additional authorization. After the decision is completed, directly output this authorization relationship type and do not execute any further decisions.
[0095] Judgment 2: If Not empty, and If the application source identifier of the current project is equal to the application identifier of the candidate application, then the application source identifier of the current project is... With service provider user identifier Between the application licensing relationship graph Does the source code import relationship exist? Perform a verification. If the verification is successful, the authorization relationship type of the candidate application is "Source Application Continuation". Otherwise, proceed to decision 3.
[0096] Judgment 3: In the application authorization relationship graph The current service provider's user identifier Is there a secondary development licensing relationship between this candidate application and the application? If the secondary development authorization relationship exists, the authorization relationship type of the candidate application is "authorized secondary development" only if the "authorization status is approved, the current time is within the authorization validity period, and the revocation status is not revoked". Otherwise, proceed to decision 4.
[0097] Judgment 4: If the source code profile quality factor of the candidate application... If the quality is below the preset quality threshold, or if the candidate application is marked as "source code profile unavailable", then the authorization relationship type of the candidate application is "candidate application source code profile unavailable"; otherwise, proceed to decision 5.
[0098] Decision 5: If the candidate application does not meet any of the conditions in Decisions 1 to 4, then the authorization relationship type of the candidate application is "unauthorized third-party reuse".
[0099] Step 7: Generate candidate gating decisions for each candidate application in the final candidate application set based on the authorization relationship type and the source code strong evidence determination result, and merge the candidate gating decisions according to the preset decision priority to generate the final gating decision result.
[0100] In one exemplary embodiment, the final gating decision result is generated based on the following judgments, specifically including: Judgment 1: For each candidate application in the final candidate application set, based on its authorization relationship type and comprehensive similarity score... The source code strong evidence judgment result and the source code profile quality factor call the gating decision function to obtain the candidate gating decision for the candidate application; wherein, the candidate gating decision includes blocking release decision, manual review decision, development period early warning decision, legal reuse decision, and pass decision. When the source code profile quality factor of the candidate application is lower than the preset quality threshold, or the candidate application is marked as "source code profile unavailable", then the candidate gating decision for the candidate application is determined to be the manual review decision.
[0101] Specifically, the system determines the type of authorization relationship. Overall similarity score Strong evidence determination based on source code and source code image quality The final remediation result is represented as follows: ; in, For gating decision functions; Authorization relationship type The warning threshold below; Authorization relationship type The system sets a lower blocking threshold for unauthorized third-party reuse and a strong source code evidence rule. For authorized secondary development, the system allows continued submission but requires the retention of the source relationship and evidence summary. For reuse within the same service provider, the system allows reuse but prompts users to maintain version and source information.
[0102] Based on the above final governance results, judgment 1 specifically includes: Judgment 1.1: When the authorization relationship type of the candidate application When the criteria are "reuse with the same service provider," "continuation of the source application," or "authorized secondary development," a valid reuse decision is generated, and when... ≥ At that time, only prompts or authorization scope confirmation information are generated, and the authorization relationship type is written into the evidence summary.
[0103] Judgment 1.2: When the source code of the candidate application provides strong evidence, the judgment result is... If true, and the authorization relationship type is... When the message is "unauthorized third-party reuse", a decision to block the release will be generated directly.
[0104] Judgment 1.3: When the source code of the candidate application provides strong evidence, the judgment result is... The condition is not true, the authorization relationship type is "unauthorized third-party reuse", the corresponding blocking threshold is enabled, and ≥ , Then a decision to block the release is generated.
[0105] Judgment 1.4: When the conditions for legal reuse, manual review, and blocking of publication are all not met: If ≥ and , Then, a development phase early warning decision is generated; if < And the source code is strong evidence for the judgment result. If it is not true, then the decision is passed.
[0106] In one exemplary embodiment, the gating decision function is expressed as: ; in, Represents the gating decision function. Indicates the type of authorization relationship. Indicates the type of authorization relationship The corresponding warning threshold, Indicates the type of authorization relationship The corresponding blocking threshold.
[0107] In one exemplary embodiment, the system independently configures an alert threshold for each type of authorization relationship R. and blocking threshold The threshold values for each authorization relationship type are determined as follows: (1) Reuse with the same service provider: warning threshold Set to a higher value (e.g., 0.85) to block the threshold. Set it to a higher value (e.g., 0.95). Reusing the same service provider is legal; the prompt to maintain version information will only appear when the similarity is extremely high, and submission will not be blocked.
[0108] (2) Source application continuation: early warning threshold Set to a medium value (e.g., 0.70) to block the threshold. Disable (i.e., do not block). The source application continues a clear and legitimate derivation relationship. Maintaining the lineage record through warning prompts is sufficient; there is no need to block it.
[0109] (3) Authorized secondary development: early warning threshold Set to a medium value (e.g., 0.60) to block the threshold. Disable (i.e., do not block). Authorized secondary development is a legitimate authorized activity, but the system should still alert the service provider to confirm the scope of authorization and retain authorization records.
[0110] (4) Unauthorized third-party reuse: warning threshold Set to a lower value (e.g., 0.40) to block the threshold. Set to a lower value (e.g., 0.60). Unauthorized third-party reuse is a high-risk behavior; use a lower blocking threshold to reduce the risk of missed detection.
[0111] (5) Candidate application source code profile is unavailable: No warning threshold or blocking threshold is set, and the application is directly transferred to the manual review process, whereby the manual review determines whether there is any reuse behavior.
[0112] and In one implementation, the specific value is configured according to the app store's governance strategy and dynamically adjusted through the management backend, taking effect without modifying the code.
[0113] The candidate gating decisions for each application are merged according to the following priority order: blocking release decision > manual review decision > development period early warning decision > legal reuse decision. The candidate gating decision with the highest priority is the final gating decision result of the final candidate application set. When there are multiple candidate applications with the same highest priority, a comprehensive similarity score will be used. The highest-ranking candidate application is determined as the primary candidate application, and the candidate gating decision corresponding to the primary candidate application is the final gating decision result of the final candidate application set.
[0114] Based on the above gating decision logic, the corresponding governance results and technical processing are shown in Table 1: Table 1: Governance results and technical processing based on the gating decision logic output
[0115] Step 8: Generate a verifiable evidence summary based on the final gating decision result, perform early warning during development and mandatory gating during release, and update the application authorization relationship graph after release submission.
[0116] In one exemplary embodiment, the steps of generating a verifiable evidence summary based on the final gating decision result, executing development-phase early warnings and release-phase mandatory gating, and updating the application authorization relationship graph include: Step 81: Write the scan identifier, trusted identity tuple, matched candidate application identifier, comprehensive similarity score and sub-scores of each dimension, matched source code fingerprint digest, matched path digest, authorization relationship type, warning threshold, blocking threshold, source code strong evidence judgment result, and final gating decision result into the verifiable evidence digest, which is represented as: ; in, Summary of verifiable evidence; This serves as the unique identifier for this scan; For trusted identity tuples in the work area; The identifier of the matched candidate application; The score is based on a combination of similarity score and sub-scores for each dimension; For the source code fingerprint digest; A summary of the hit path; This is the type of authorization relationship; This serves as the final gating decision. Through verifiable evidence summaries, the system can explain the basis for similarity governance without disclosing the original source code.
[0117] Specifically, a verifiable evidence summary must contain at least the following complete information: (1) Scan metadata: scan identifier scanld, scan timestamp, scan type (development period / release period), scan trigger reason.
[0118] (2) Workspace Identity Information: Workspace Identity Summary (for...) middle , , , , The hash representation of the field is used to trace the source of the scan request.
[0119] (3) Information on the matched candidate applications: Candidate application identifier Application owner Source code package version number .
[0120] (4) Similarity score details: Comprehensive similarity score and sub-scores of each dimension and the corresponding weight coefficients for each dimension. .
[0121] (5) Details of the hit evidence: number of hit source code fingerprints, list of hit file paths (maximum preset number, such as the first 20 paths), and distribution of hit paths. The top 10 file paths with the highest fingerprint density were identified.
[0122] (6) Authorization relationship information: Authorization relationship type R, authorization determination basis (e.g.) edge or The existence and attributes of edges), and the authorization record identifier (if a valid authorization exists).
[0123] (7) Thresholds and decision information: Early warning thresholds Blocking threshold Strong evidence markers from source code Final gating decision results .
[0124] (8) Evidence verification information: Evidence digest hash value Evidence generation time and evidence version number.
[0125] In one implementation, the evidence summary is stored in a structured format (such as JSON) and appended with a digital signature or an HMAC-based integrity check value to ensure that the content of the evidence summary has not been tampered with after its generation. Reviewers can use the verification tool provided by the system to input the scan identifier `scanld` to query the original evidence data, recalculate the hash value, and compare it with the stored data to verify the authenticity and integrity of the evidence.
[0126] In one exemplary embodiment, after the evidence summary is generated, the following persistence operation is performed: (1) Summary of evidence The complete evidence data contained therein is written into the evidence database or evidence storage service, with the scan identifier scanld as the primary key, supporting subsequent precise queries and evidence export through scanld; (2) If the gating decision result is a non-blocking result (i.e., manual review decision, development period early warning decision, legal reuse decision, or approval decision), the evidence summary will be... The application identifier, version number, and submission time of this release are associated and stored together, so that each released application can trace the similarity scan evidence at the time of its release. (3) If the gating decision result is a blocking result (blocking the release decision), the evidence summary will be... The blocked records are stored together, including the blocking time, the blocked service provider, and the reason for the blocking, so that subsequent reviewers can view the detailed evidence submitted after the blocking.
[0127] Step 82: During the development scan, when the final gating decision result is a development warning decision, the matching application, similarity score and suggested action will be returned to the development tool for prompting, and development will be allowed to continue.
[0128] In a demonstrative implementation, such as Figure 2 As shown, development scans are triggered in the following ways: (1) First startup trigger: After the first source code profile scan is completed in step 2, the first similarity scan is automatically triggered to identify whether the current project has similar risks to the released application in the early stage of development; (2) Manual trigger: The service provider triggers the scan when it actively clicks the "Check Similarity" button in the development tool, which is used to actively confirm the similarity status of the current project before submitting the release; (3) Scheduled inspection trigger: In one implementation, if the current work area continues to run and no file changes occur for more than a preset time (e.g., 2 hours), an inspection scan is automatically triggered to identify similar risks introduced through non-file change methods.
[0129] After triggering the scan using the above method, the candidate application recall, precise scoring, and gating decision-making process described in steps 4 to 7 is executed. The obtained development-phase scan results are returned to the front end of the development tool as early warning information through the event channel. The early warning information includes the maximum similarity score, the name of the matched candidate application, sub-scores for each dimension, governance results, and suggested actions. Suggested actions include, but are not limited to: applying for secondary development authorization, confirming whether it is reused by the same service provider, supplementing the source declaration, and adjusting the project implementation to reduce similarity. This result is used to remind service providers to apply for secondary development authorization or adjust the project implementation in a timely manner during the development process.
[0130] To avoid disrupting service providers with repeated alerts, one implementation implements a frequency-limiting strategy for the same governance results of the same candidate application on the developer tool frontend: the same candidate application and the same governance result will only display an alert once within a preset time window (e.g., 30 minutes), and subsequent scan results will only update the backend records without repeatedly popping up frontend notifications. When the governance result changes (e.g., a development-phase alert changes to "passed"), a new notification will be displayed immediately.
[0131] Step 83: During the release submission phase, perform a forced scan before the application package and source code package enter the storage and review process; when the final gating decision is to block the release, return a conflict result and block the release submission; when the final gating decision is to pass or legal reuse, allow entry into the storage and review process; when the final gating decision is to manually review, proceed to the manual review process.
[0132] In a demonstrative implementation, such as Figure 2 As shown, when submitting a release, the system re-executes similarity management on the submitted source code package and metadata.
[0133] The relationship between release-phase scanning and development-phase scanning is as follows: (1) If the current workspace has completed the development phase scan within the most recent preset time (e.g., within 5 minutes) and no new document change events have occurred since the development phase scan, the release phase scan will directly reuse the profile and scoring results of the most recent development phase scan, and will not repeat the fingerprint calculation and comparison.
[0134] (2) If the current workspace has not performed a development scan within the most recent preset time, or if there have been file changes after the development scan, the release scan will re-execute the complete process of steps 2 to 7.
[0135] If the gating decision is to block the release, the system will return a conflict result before saving the application package and source code package, and will not write it into the application pending review record; if the result is a development warning, legal reuse, or approval, the system will continue to save the application package and source code package, and associate the scan result with the submission record.
[0136] Step 84: After the release submission is completed, if the authorization relationship type is source application continuation or authorized secondary development, record the valid source code import source relationship and update the application authorization relationship graph; if the authorization relationship type is reuse within the same service provider, record the version evolution relationship; if the final gating decision result is a release blocking decision, do not add a new authorization relationship and record the blocking audit information.
[0137] In one exemplary embodiment, after the release submission is completed, the application licensing relationship graph is updated based on the results of this governance effort. This is to enable the continuous evolution and state synchronization of the application authorization relationship graph. (1) If the gating decision result is a valid reuse decision and the service provider successfully submits a secondary development version based on the authorized application, then check whether there is already a relationship between the current project and the source application in the application authorization relationship graph. If an edge does not exist, create a new one. The edge records the source code import relationship, and records the newly submitted application version as a derived node of the source application in the application authorization relationship graph.
[0138] (2) If the gating decision result is a valid reuse decision and the service provider successfully submits an iterative version of its own application, then it is an application node in the application authorization relationship graph. A new version attribute is added to record version evolution relationships, and new versions are recorded as version evolution branches of the same application node in the application authorization relationship graph.
[0139] (3) If the gating decision result is to block the release decision, the application authorization relationship graph will not be updated, but the blocking event will be recorded in the audit log of the application authorization relationship graph for subsequent analysis of blocking mode and optimization of threshold configuration.
[0140] Through the aforementioned application licensing relationship graph update mechanism, the application licensing relationship graph... It continues to evolve after each release and submission, gradually forming a complete application genealogy network, providing richer relational data support for subsequent similarity governance.
[0141] The authorization gating system based on multi-tenant source code profile similarity governance described in this application includes a construction module, an incremental source code profile module, a candidate profile index module, a recall scoring module, a strong evidence calculation module, an authorization relationship type calculation module, a gating decision generation module, and a gating execution module.
[0142] The building module is used to construct and associate trusted identity tuples and application authorization relationship graphs in the current workspace.
[0143] The incremental source code profiling module is used to incrementally build a source code profile of the current workspace based on file change events.
[0144] The candidate profile index module is used to build index items for the profiles of the source code of the reviewed candidate applications.
[0145] The recall and scoring module is used to recall and score candidate applications in multiple dimensions based on the index items of the current workspace source code profile and the candidate application source code profile, so as to obtain the final set of candidate applications.
[0146] The strong evidence calculation module is used to calculate the source code strong evidence determination result for each candidate application in the final candidate application set.
[0147] The authorization relationship type calculation module is used to determine the authorization relationship type of each candidate application in the final candidate application set based on the application authorization relationship graph.
[0148] The gating decision generation module is used to generate candidate gating decisions for each candidate application in the final candidate application set based on the authorization relationship type and the source code strong evidence judgment result, and to merge the candidate gating decisions according to the preset decision priority to generate the final gating decision result.
[0149] The gating execution module is used to generate a verifiable evidence summary based on the final gating decision result, perform early warning during development and mandatory gating during release, and update the application authorization relationship graph after release submission.
[0150] In one specific embodiment, service provider A has released the tool in the app store. And upload the source code package. The system will process the data upon approval. Generate a candidate application source code profile, saving the source code token fingerprint, directory structure, dependency digest, interface path, manifest capability declaration, and MinHash digest. After service provider B enters the online development tool, the scheduler creates a workspace for it. It also generates service provider user identifiers, route identifiers, and workspace tokens.
[0151] If service provider B has already obtained the rights Secondary development authorization, and import from the cloud. In the source code, the workspace project record carries the application source identifier. If service provider B modifies some front-end interfaces and server-side interfaces during development, the system only recalculates the profile for the changed files and sends the workspace profile summary to the app store backend. The backend then uses the MinHash summary to recall the app. Then, a precise scoring was performed, yielding a source code profile similarity of 0.91, a structural similarity of 0.88, a dependency graph similarity of 0.93, and a capability declaration similarity of 0.86. The overall score reached the blocking threshold. This is because the authorization relationship graph contains service provider B... If the authorization is valid, the gating decision result is a legitimate reuse decision, the system allows continued development and submission, and writes the authorization record into the evidence digest.
[0152] If another service provider C did not obtain authorization but submitted a request related to Highly similar source code packages are scanned by the system during the release submission phase, and the first phase of recall is performed. The second phase of calculation yielded a source code token fingerprint similarity of 0.89, with the number of matching fingerprints exceeding the minimum threshold. The matching paths covered the front-end entry point, back-end controller, and configuration files. Even if service provider C modified the application name, summary, and category, resulting in lower metadata similarity, the system still generated a blocking release decision based on the strong evidence rules of the source code and returned a conflict response before saving the application package, prompting C to apply for secondary development authorization.
[0153] In the above embodiments, the system does not need to scan at fixed intervals when the workspace remains unchanged, nor does it need to download all audited source code packages during each scan. The development side reuses the file profile cache, the server side reuses the candidate profile index, the first-stage summary recall reduces the number of candidates for precise comparison, and the second-stage multi-dimensional scoring and authorization relationship determination ensure that the governance results are interpretable and executable.
[0154] The above are exemplary embodiments of this application, and the scope of protection of this application is defined by the claims and their equivalents.
Claims
1. An authorization gating method based on multi-tenant source code profile similarity governance, characterized in that, include: Construct and associate trusted identity tuples and application authorization relationship graphs in the current work area; Construct a source code profile of the current workspace based on incremental file change events; Construct an index of source code profiles for the reviewed candidate applications; Based on the index items of the current workspace source code profile and the candidate application source code profile, the candidate applications are recalled and scored in multiple dimensions to obtain the final set of candidate applications; The source code strong evidence determination result is calculated for each candidate application in the final candidate application set; The authorization relationship type of each candidate application in the final candidate application set is determined based on the application authorization relationship graph. Based on the authorization relationship type and the source code strong evidence judgment result, candidate gating decisions are generated for each candidate application in the final candidate application set, and the candidate gating decisions are merged according to the preset decision priority to generate the final gating decision result. Based on the final gating decision result, a verifiable evidence summary is generated, development-phase early warning and release-phase mandatory gating are executed, and the application authorization relationship graph is updated after the release submission is completed.
2. The authorization gating method as described in claim 1, characterized in that, The construction and association of the trusted workspace identity and application authorization relationship graph in the current workspace includes: Use development tools to create or reuse the current workspace and generate a trusted identity tuple for that workspace, represented as: ; in, This represents the trusted identity tuple in the current work area. Indicates the service provider user identifier. Indicates the current workspace routing identifier. Indicates the user's workspace token. Indicates the container identifier of the current workspace. Indicates the current project identifier. This indicates the application source identifier for the current project. Indicates the time the identity was generated or the time the identity was refreshed; The application licensing relationship graph is constructed as follows: ; Represents the application licensing relationship graph. This represents a set of application nodes that have been published or are awaiting review. Represents a set of service provider nodes. This represents the set of authorized nodes for secondary development. Indicates ownership relationship of the application. This indicates a secondary development authorization relationship. This indicates the source code import relationship. This indicates the authorization status, approval time, scope of authorization, validity period, and revocation status. Based on the trusted identity tuple of the work area, the current project in the current work area... Application source identifier Check if it is empty; if not, then set the current project... Service Provider User Identifier Corresponding service provider node and application source identifier The relationships between them are used as source relationships to be verified, and are associated with and verified against the application ownership relationships and secondary development authorization relationships in the application authorization relationship graph; after verification, the valid source code is imported into the source relationship. Write the application authorization relationship graph; if the verification fails, mark it as pending review.
3. The authorization gating method as described in claim 2, characterized in that, The construction of the current workspace source code profile based on incremental file change events includes: For local files The image cache table is maintained, and the image cache table is represented as follows: ; in, Representing a path Corresponding local file Image cache table, Represents local files Content hash value, Represents local files Modification timestamp, Represents local files Number of bytes, Represents local files The source code of the token fingerprint collection, Represents local files The set of directory structure path features, Represents local files The set of dependency features involved Represents local files The set of interface call characteristics included. Represents local files The set of capability declaration features involved; Trigger the initial scan and listen for file change events; For the monitored files The file's content hash value, modification timestamp, and number of bytes are read to perform file operations. Content hash value, modification timestamp, and number of bytes compared to local files Image cache table The corresponding items in the file are compared: if any of the content hash value, modification timestamp, and number of bytes changes, then the file is modified accordingly. The corresponding source code token fingerprint set, directory structure path feature set, dependency relationship feature set, interface call feature set, and capability declaration feature set are regenerated, and the newly generated feature set is updated to the profile cache table. The corresponding item in the file; if the content hash value, modification timestamp, and number of bytes have not changed, then the file Directly reuse the image cache table The stored features include a set of source code token fingerprints, a set of directory structure path features, a set of dependency relationship features, a set of API call features, and a set of capability declaration features; among these, Indicates the first The current file that needs to generate a source code profile; The feature sets of newly created or modified files during this scan are compared with those of unchanged files in the image cache table. The historical feature sets in the current workspace are merged, and cache entries and feature sets corresponding to deleted files are removed. Simultaneously, the file change set and feature change set relative to the last scan are recorded, forming an incremental source code profile of the current workspace that covers all existing files in the current workspace, represented as: ; in, This represents the current working area source code profile after the increment. This represents the set of source code token fingerprints for all files in the current working directory. This represents the set of directory structure path features for all files in the current workspace. This represents the set of dependency features for all files in the current workspace. This represents the set of interface call characteristics for all files in the current workspace. This represents the set of capability declaration features for all files in the current workspace. This represents a lightweight digest generated from a set of source code token fingerprints. This represents the set of file changes and feature changes in this scan compared to the previous scan.
4. The authorization gating method as described in claim 3, characterized in that, The construction of the index items for the source code profile of the reviewed candidate applications includes: The timing and triggering method for generating candidate application source code profiles are determined. Generate source code profiles for the source code packages of the approved candidate applications; The generated candidate application source code profiles are organized into index items and written to the index store. These index items are represented as follows: ; in, Indicates candidate applications The index item of the source code portrait, The application identifier that represents the candidate application. This indicates the owner / service provider identifier of the candidate application. This indicates the version number of the candidate application's source code package. This represents the set of source code token fingerprints for candidate applications. This represents the set of directory structure path features for candidate applications. This represents the set of dependency features for candidate applications. This represents the set of API call characteristics for candidate applications. This represents the set of capability declaration features for candidate applications. This represents a lightweight digest generated from the set of source code token fingerprints of the candidate application. This represents the source code profile quality factor.
5. The authorization gating method as described in claim 4, characterized in that, The process of recalling and multi-dimensionally scoring candidate applications yields a final set of candidate applications, including: Phase 1 Recall: Retrieving lightweight summaries from the current workspace's source code profile. As a query vector, the current workspace source code profile is compared with the lightweight summary corresponding to all data in the candidate application source code profile. When a candidate application meets the corresponding recall threshold in at least one dimension, the candidate application is included in the candidate application set. Then the candidate application set It should meet the following requirements: ; in, Lightweight summary With lightweight summary Similarity; , , , This represents the lightweight summary similarity between the current workspace source code profile and the candidate application source code profile, which includes the set of directory structure path features, dependency relationship features, interface call features, and capability declaration features. , , , , These are the recall thresholds for each dimension; Phase Two: Multi-Dimensional Scoring; Profiling the Source Code of the Current Workspace and the Set of Candidate Applications The comprehensive similarity score of the source code profile of each candidate application is calculated and expressed as follows: ; in, This represents the overall similarity score between the current workspace's source code profile after incremental updates and the candidate application's source code profile. The Jaccard similarity of the source code token fingerprint set between the current workspace source code profile and the candidate application source code profile after incremental modification is represented. The Jaccard similarity of the directory structure path feature set between the current workspace source code profile and the candidate application source code profile after incremental update. This indicates the similarity of the dependency feature set between the current workspace's incremental source code profile and the candidate application's source code profile. This represents the Jaccard similarity of the set of interface call features between the current workspace source code profile and the candidate application source code profile after incremental updates. The Jaccard similarity of the capability declaration feature set between the current workspace incremental source code profile and the candidate application source code profile; This indicates the semantic similarity of metadata between the current workspace's incremental source code profile and the candidate application's source code profile. , , , , and These represent the weight coefficients for each dimension, and ; Candidate application set The candidate applications are sorted from highest to lowest based on their overall similarity score, and the top N candidate applications with the highest overall similarity scores are retained to form the final candidate application set; where, if the candidate application set... If the value is empty, then all candidate applications are directly determined to have no similar risks.
6. The authorization gating method as described in claim 5, characterized in that, The calculation of the source code strong evidence determination result for each candidate application in the final candidate application set includes: When a candidate application meets When the source code of the candidate application is used as strong evidence, the result of the assessment will be as follows: True; When a candidate application does not meet the requirements When the source code of the candidate application is used as strong evidence, the result of the assessment will be as follows: Not true; in, This indicates the result of the strong evidence assessment based on the source code. This represents the threshold for source code token fingerprint similarity. Indicates the minimum number of fingerprints that must be matched; This represents the number of identical fingerprints matched in the source code token fingerprint sets of the current workspace source code profile and the candidate application source code profile. This indicates the path distribution degree of files involving the same fingerprint in candidate applications; This represents the path distribution threshold.
7. The authorization gating method as described in claim 6, characterized in that, The authorization relationship type of each candidate application in the final candidate application set is determined based on the application authorization relationship graph, including: The authorization relationship function for each candidate application in the final candidate application set is constructed as follows: ; in, This indicates the type of authorization relationship between the current workspace and the candidate application. This indicates the candidate application The owner; The authorization relationship type of the candidate application is determined based on the authorization relationship function according to the priority order, which is: Decision 1 > Decision 2 > Decision 3 > Decision 4 > Decision 5, specifically including: Judgment 1: If This means that the service provider in the current workspace and the owner of the candidate application are the same service provider, and the authorization relationship type of the candidate application is "same service provider reuse"; if Proceed to Decision 2; Judgment 2: If Not empty, and If the application source identifier of the current project is equal to the application identifier of the candidate application, then the application source identifier of the current project is... With service provider user identifier Between the application licensing relationship graph Does the source code import relationship exist? Perform verification; if so, the authorization relationship type of the candidate application is "source application continuation"; otherwise, proceed to decision 3. Judgment 3: In the application authorization relationship graph The current service provider's user identifier Is there a secondary development licensing relationship between this candidate application and the application? If the secondary development authorization relationship exists, the authorization relationship type of the candidate application is "authorized secondary development" only if the "authorization status is approved, the current time is within the authorization validity period, and the revocation status is not revoked". Otherwise, proceed to decision 4. Judgment 4: If the source code profile quality factor of the candidate application... If the quality is below the preset quality threshold, or if the candidate application is marked as "source code profile unavailable", then the authorization relationship type of the candidate application is "candidate application source code profile unavailable"; otherwise, proceed to decision 5. Decision 5: If the candidate application does not meet any of the conditions in Decisions 1 to 4, then the authorization relationship type of the candidate application is "unauthorized third-party reuse".
8. The authorization gating method as described in claim 7, characterized in that, The generation of the final gating decision result includes: Judgment 1: For each candidate application in the final candidate application set, based on its authorization relationship type and comprehensive similarity score... The source code strong evidence judgment result and the source code profile quality factor call the gating decision function to obtain the candidate gating decision for the candidate application; wherein, the candidate gating decision includes blocking release decision, manual review decision, development period early warning decision, legal reuse decision, and pass decision. When the source code profile quality factor of the candidate application is lower than the preset quality threshold, or the candidate application is marked as "source code profile unavailable", then the candidate gating decision for the candidate application is determined to be the manual review decision. The candidate gating decisions for each application are merged according to the following priority order: blocking release decision > manual review decision > development period early warning decision > legal reuse decision. The candidate gating decision with the highest priority is the final gating decision result of the final candidate application set. When there are multiple candidate applications with the same highest priority, a comprehensive similarity score will be used. The highest-ranking candidate application is determined as the primary candidate application, and the candidate gating decision corresponding to the primary candidate application is the final gating decision result of the final candidate application set. The gating decision function is expressed as follows: ; in, Represents the gating decision function. Indicates the type of authorization relationship. Indicates the type of authorization relationship The corresponding warning threshold, Indicates the type of authorization relationship The corresponding blocking threshold; The judgment 1 specifically includes: Judgment 1.1: When the authorization relationship type of the candidate application When the criteria are "reuse with the same service provider," "continuation of the source application," or "authorized secondary development," a valid reuse decision is generated, and when... ≥ At that time, only prompts or authorization scope confirmation information are generated, and the authorization relationship type is written into the evidence digest; Judgment 1.2: When the source code of the candidate application provides strong evidence... If true, and the authorization relationship type is... When the issue is "unauthorized third-party reuse", a decision to block the release will be generated directly. Judgment 1.3: When the source code of the candidate application provides strong evidence, the judgment result is... The condition is not true, the authorization relationship type is "unauthorized third-party reuse", the corresponding blocking threshold is enabled, and ≥ , Then a decision to block the release is generated; Judgment 1.4: When the conditions for legal reuse, manual review, and blocking of publication are all not met, if ≥ and , Then, a development phase early warning decision is generated; if < And the source code is strong evidence for the judgment result. If it is not true, then the decision is passed.
9. The authorization gating method as described in claim 8, characterized in that, The process of generating a verifiable evidence summary based on the final gating decision result, executing development-phase early warnings and release-phase mandatory gating, and updating the application authorization relationship graph includes: The scan identifier, trusted identity tuple, the candidate application identifier that was hit, the comprehensive similarity score and sub-scores of each dimension, the source code fingerprint digest that was hit, the path digest that was hit, the authorization relationship type, the warning threshold, the blocking threshold, the source code strong evidence judgment result, and the final gating decision result are written into the verifiable evidence digest. During development scanning, when the final gating decision is a development warning decision, the matching application, similarity score, and suggested actions will be returned to the development tool for prompting, and development will be allowed to continue. During the release submission phase, a forced scan is performed before the application package and source code package enter the storage and review process; when the final gating decision is to block the release, a conflict result is returned and the release submission is blocked; when the final gating decision is to pass or legal reuse, entry into the storage and review process is allowed; when the final gating decision is to conduct a manual review, the process is transferred to the manual review process. After the release submission is completed, if the authorization relationship type is source application continuation or authorized secondary development, the valid source code import source relationship is recorded and the application authorization relationship graph is updated; if the authorization relationship type is reuse within the same service provider, the version evolution relationship is recorded; if the final gating decision result is a release blocking decision, no new authorization relationship is added and the blocking audit information is recorded.
10. An authorization gating system based on multi-tenant source code profile similarity governance, characterized in that, The authorization gating system is used to implement the authorization gating method according to any one of claims 1 to 9, and the authorization gating system includes: The building module is used to construct and associate trusted identity tuples and application authorization relationship graphs in the current workspace; The incremental source code profiling module is used to build a source code profile of the current workspace based on file change events. The candidate profile index module is used to construct index items for the profiles of the source code of the reviewed candidate applications; The recall and scoring module is used to recall and score candidate applications in multiple dimensions based on the index items of the current workspace source code profile and the candidate application source code profile, so as to obtain the final set of candidate applications. The strong evidence calculation module is used to calculate the source code strong evidence determination result for each candidate application in the final candidate application set. The authorization relationship type calculation module is used to determine the authorization relationship type of each candidate application in the final candidate application set based on the application authorization relationship graph; The gating decision generation module is used to generate candidate gating decisions for each candidate application in the final candidate application set based on the authorization relationship type and the source code strong evidence judgment result, and to merge the candidate gating decisions according to the preset decision priority to generate the final gating decision result. The gating execution module is used to generate a verifiable evidence summary based on the final gating decision result, perform early warning during development and mandatory gating during release, and update the application authorization relationship graph after release submission.
