diff --git a/build/jobs/analyze.yml b/build/jobs/analyze.yml index 5ad0110a60..2ccbb08ccd 100644 --- a/build/jobs/analyze.yml +++ b/build/jobs/analyze.yml @@ -89,12 +89,14 @@ steps: Path: '$(Build.SourcesDirectory)' ToolVersion: Latest -- task: Trivy@1 - displayName: 'Run Trivy' - inputs: - Target: '$(Build.SourcesDirectory)/build/docker' - Severities: all - VulTypes: all +## Currently removed due to too many requests issue: https://github.com/aquasecurity/trivy-action/issues/430 +## User story to address restoring this: 132160 +#- task: Trivy@1 +# displayName: 'Run Trivy' +# inputs: +# Target: '$(Build.SourcesDirectory)/build/docker' +# Severities: all +# VulTypes: all - task: PSScriptAnalyzer@1 displayName: 'Run PSScriptAnalyzer' diff --git a/build/jobs/docker-build-push.yml b/build/jobs/docker-build-push.yml index 7802f6c0e5..708da87e2d 100644 --- a/build/jobs/docker-build-push.yml +++ b/build/jobs/docker-build-push.yml @@ -22,6 +22,7 @@ jobs: scriptType: 'bash' scriptLocation: 'inlineScript' inlineScript: | + docker pull mirror.gcr.io/moby/buildkit:buildx-stable-1 TAG="$(azureContainerRegistry)/${{parameters.version}}_fhir-server:${{parameters.tag}}" az acr login --name $(azureContainerRegistryName) docker buildx create --name fhir-multi-platform --platform ${{parameters.buildPlatform}} --use --bootstrap diff --git a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Search/Registry/SearchParameterStatusManagerTests.cs b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Search/Registry/SearchParameterStatusManagerTests.cs index 6bdf7a6849..53688b3f01 100644 --- a/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Search/Registry/SearchParameterStatusManagerTests.cs +++ b/src/Microsoft.Health.Fhir.Core.UnitTests/Features/Search/Registry/SearchParameterStatusManagerTests.cs @@ -34,6 +34,7 @@ public class SearchParameterStatusManagerTests private static readonly string ResourceProfile = "http://hl7.org/fhir/SearchParameter/Resource-profile"; private static readonly string ResourceSecurity = "http://hl7.org/fhir/SearchParameter/Resource-security"; private static readonly string ResourceQuery = "http://hl7.org/fhir/SearchParameter/Resource-query"; + private static readonly string ResourceSource = "http://hl7.org/fhir/SearchParameter/Resource-source"; private readonly SearchParameterStatusManager _manager; private readonly ISearchParameterStatusDataStore _searchParameterStatusDataStore; @@ -85,6 +86,12 @@ public SearchParameterStatusManagerTests() Uri = new Uri(ResourceSecurity), LastUpdated = Clock.UtcNow, }, + new ResourceSearchParameterStatus + { + Status = SearchParameterStatus.Disabled, + Uri = new Uri(ResourceSource), + LastUpdated = Clock.UtcNow, + }, }; _searchParameterStatusDataStore.GetSearchParameterStatuses(Arg.Any()).Returns(_resourceSearchParameterStatuses); @@ -99,6 +106,7 @@ public SearchParameterStatusManagerTests() new SearchParameterInfo("_profile", "_profile", SearchParamType.Token, new Uri(ResourceProfile), targetResourceTypes: targetResourceTypes), new SearchParameterInfo("_security", "_security", SearchParamType.Token, new Uri(ResourceSecurity), targetResourceTypes: targetResourceTypes), _queryParameter, + new SearchParameterInfo("_source", "_source", SearchParamType.Uri, new Uri(ResourceSource), targetResourceTypes: targetResourceTypes), }; _searchParameterDefinitionManager.GetSearchParameters("Account") @@ -117,6 +125,10 @@ public SearchParameterStatusManagerTests() _searchParameterSupportResolver .IsSearchParameterSupported(Arg.Is(_searchParameterInfos[4])) .Returns((true, false)); + + _searchParameterSupportResolver + .IsSearchParameterSupported(Arg.Is(_searchParameterInfos[5])) + .Returns((true, false)); } [Fact] @@ -145,6 +157,11 @@ public async Task GivenASPStatusManager_WhenInitializing_ThenSearchParameterIsUp Assert.False(list[4].IsSearchable); Assert.True(list[4].IsSupported); Assert.False(list[4].IsPartiallySupported); + + Assert.False(list[5].IsSearchable); + Assert.False(list[5].IsSupported); // Disabled Search Params show as unsupported + Assert.False(list[5].IsPartiallySupported); + Assert.Equal(SearchParameterStatus.Disabled, list[5].SearchParameterStatus); } [Fact] diff --git a/src/Microsoft.Health.Fhir.Core/Features/Search/Registry/SearchParameterStatusManager.cs b/src/Microsoft.Health.Fhir.Core/Features/Search/Registry/SearchParameterStatusManager.cs index 44f407689f..ad4f72819e 100644 --- a/src/Microsoft.Health.Fhir.Core/Features/Search/Registry/SearchParameterStatusManager.cs +++ b/src/Microsoft.Health.Fhir.Core/Features/Search/Registry/SearchParameterStatusManager.cs @@ -81,12 +81,14 @@ internal async Task EnsureInitializedAsync(CancellationToken cancellationToken) if (p.IsSearchable != tempStatus.IsSearchable || p.IsSupported != tempStatus.IsSupported || p.IsPartiallySupported != tempStatus.IsPartiallySupported || - p.SortStatus != result.SortStatus) + p.SortStatus != result.SortStatus || + p.SearchParameterStatus != result.Status) { p.IsSearchable = tempStatus.IsSearchable; p.IsSupported = tempStatus.IsSupported; p.IsPartiallySupported = tempStatus.IsPartiallySupported; p.SortStatus = result.SortStatus; + p.SearchParameterStatus = result.Status; updated.Add(p); } diff --git a/src/Microsoft.Health.Fhir.Core/Features/Security/DataActions.cs b/src/Microsoft.Health.Fhir.Core/Features/Security/DataActions.cs index 27eb096a0f..5bbcd8ddf8 100644 --- a/src/Microsoft.Health.Fhir.Core/Features/Security/DataActions.cs +++ b/src/Microsoft.Health.Fhir.Core/Features/Security/DataActions.cs @@ -30,6 +30,6 @@ public enum DataActions : ulong Smart = 1 << 30, // Do not include Smart in the '*' case. We only want smart for a user if explicitly added to the role or user [EnumMember(Value = "*")] - All = (Import << 1) - 1, + All = (SearchParameter << 1) - 1, } }