using Bit.Core.Abstractions; namespace Bit.Core.Services { public class AssetLinksService : IAssetLinksService { private readonly IApiService _apiService; public AssetLinksService(IApiService apiService) { _apiService = apiService; } /// /// Gets the digital asset links file associated with the and /// validates that the and matches. /// /// True if matches, False otherwise. public async Task ValidateAssetLinksAsync(string rpId, string packageName, string normalizedFingerprint) { var statementList = await _apiService.GetDigitalAssetLinksForRpAsync(rpId); return statementList .Any(s => s.Target.Namespace == "android_app" && s.Target.PackageName == packageName && s.Relation.Contains("delegate_permission/common.get_login_creds") && s.Relation.Contains("delegate_permission/common.handle_all_urls") && s.Target.Sha256CertFingerprints.Contains(normalizedFingerprint)); } } }