From 39a9f377bf5aa044b6595967f54ea4fe74a97eec Mon Sep 17 00:00:00 2001 From: semalaiappan <34613894+semalaiappan@users.noreply.github.com> Date: Sat, 18 Mar 2023 18:03:02 -0500 Subject: [PATCH 1/8] [ODS-5764] Profile usage is not enforced (v6.1) (#633) * [ODS-5764] Profile usage is not enforced (v5.3) (#630) * Enabled Profiles feature on integration test harness. (#626) * Enabled all Plugin except Profiles.Sample Extension based on Testharness Project Plugin Folder --------- Co-authored-by: Geoff McElhanon * IContextProvider dataManagementRequestContextProvider updated --------- Co-authored-by: Geoff McElhanon --- .../EdFi.Ods.Api.IntegrationTestHarness.csproj | 2 +- .../OwnershipInitializationCreateEntityDecorator.cs | 7 ++++--- .../scripts/modules/settings/settings-management.psm1 | 8 +++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Application/EdFi.Ods.Api.IntegrationTestHarness/EdFi.Ods.Api.IntegrationTestHarness.csproj b/Application/EdFi.Ods.Api.IntegrationTestHarness/EdFi.Ods.Api.IntegrationTestHarness.csproj index a9fe7dd9f..d7ed8d8f3 100644 --- a/Application/EdFi.Ods.Api.IntegrationTestHarness/EdFi.Ods.Api.IntegrationTestHarness.csproj +++ b/Application/EdFi.Ods.Api.IntegrationTestHarness/EdFi.Ods.Api.IntegrationTestHarness.csproj @@ -25,7 +25,7 @@ PreserveNewest - + diff --git a/Application/EdFi.Ods.Features.OwnershipBasedAuthorization/Security/OwnershipInitializationCreateEntityDecorator.cs b/Application/EdFi.Ods.Features.OwnershipBasedAuthorization/Security/OwnershipInitializationCreateEntityDecorator.cs index 2413ca7aa..da0354563 100644 --- a/Application/EdFi.Ods.Features.OwnershipBasedAuthorization/Security/OwnershipInitializationCreateEntityDecorator.cs +++ b/Application/EdFi.Ods.Features.OwnershipBasedAuthorization/Security/OwnershipInitializationCreateEntityDecorator.cs @@ -18,6 +18,7 @@ using EdFi.Ods.Common.Infrastructure.Filtering; using EdFi.Security.DataAccess.Repositories; using NHibernate; +using EdFi.Ods.Common.Context; namespace EdFi.Ods.Features.OwnershipBasedAuthorization.Security { @@ -41,7 +42,7 @@ public class OwnershipInitializationCreateEntityDecorator /// /// /// - /// + /// public OwnershipInitializationCreateEntityDecorator( ICreateEntity next, IAuthorizationContextProvider authorizationContextProvider, @@ -53,7 +54,7 @@ public OwnershipInitializationCreateEntityDecorator( ISessionFactory sessionFactory, IApiKeyContextProvider apiKeyContextProvider, IViewBasedSingleItemAuthorizationQuerySupport viewBasedSingleItemAuthorizationQuerySupport, - IDataManagementRequestContextProvider dataManagementRequestContextProvider) + IContextProvider dataManagementResourceContextProvider) : base( authorizationContextProvider, authorizationFilteringProvider, @@ -64,7 +65,7 @@ public OwnershipInitializationCreateEntityDecorator( sessionFactory, apiKeyContextProvider, viewBasedSingleItemAuthorizationQuerySupport, - dataManagementRequestContextProvider) + dataManagementResourceContextProvider) { _next = Preconditions.ThrowIfNull(next, nameof(next)); _apiKeyContextProvider = Preconditions.ThrowIfNull(apiKeyContextProvider, nameof(apiKeyContextProvider)); diff --git a/logistics/scripts/modules/settings/settings-management.psm1 b/logistics/scripts/modules/settings/settings-management.psm1 index 98fd62473..d548c4674 100644 --- a/logistics/scripts/modules/settings/settings-management.psm1 +++ b/logistics/scripts/modules/settings/settings-management.psm1 @@ -537,6 +537,12 @@ function Add-TestSpecificAppSettings([hashtable] $Settings = @{ }, [string] $Pro $newSettings = @{ ConnectionStrings = @{ } + ApiSettings = @{ + Mode = "SharedInstance" + } + Plugin = @{ + Folder = "Plugin" + } } $csbs = Get-ConnectionStringBuildersFromSettings $Settings @@ -593,11 +599,11 @@ function New-DevelopmentAppSettings([hashtable] $Settings = @{ }) { $newDevelopmentSettings = Merge-Hashtables $developmentSettingsByProject[$project], $newDevelopmentSettings $newDevelopmentSettings = Add-TestSpecificAppSettings $newDevelopmentSettings $project - $newDevelopmentSettings = Add-TestHarnessSpecificAppSettings $newDevelopmentSettings $project $newDevelopmentSettings = Merge-Hashtables $newDevelopmentSettings, $credentialSettingsByProject[$project], $Settings $newDevelopmentSettings = Remove-WebApiSpecificSettings $newDevelopmentSettings $project + $newDevelopmentSettings = Add-TestHarnessSpecificAppSettings $newDevelopmentSettings $project $projectPath = Get-RepositoryResolvedPath $Project From c4f13344d5d068e1c260543a9019349141254345 Mon Sep 17 00:00:00 2001 From: "m.semalaiappan" Date: Thu, 22 Jun 2023 13:49:19 -0500 Subject: [PATCH 2/8] BUILD_INCREMENTER updated --- .../workflows/InitDev,Unit tests,Integration tests,Package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml b/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml index 85ba4ec6a..855e76c70 100644 --- a/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml +++ b/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml @@ -16,7 +16,7 @@ on: env: INFORMATIONAL_VERSION: "6.1" - BUILD_INCREMENTER: "1" + BUILD_INCREMENTER: "-1050" CONFIGURATION: "Release" VERSION_MAJOR: "6" VERSION_MINOR: "1" From 47177dd63a5a9d077cfd25dd34ba484e98ccbd82 Mon Sep 17 00:00:00 2001 From: "m.semalaiappan" Date: Thu, 22 Jun 2023 15:55:34 -0500 Subject: [PATCH 3/8] Publish to Azure Artifacts step added --- ...tDev,Unit tests,Integration tests,Package.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml b/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml index 855e76c70..044b597a1 100644 --- a/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml +++ b/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml @@ -25,6 +25,9 @@ env: REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }} EDFI_SUITE_NUMBER: "Suite3" msbuild_buildConfiguration: "release" + AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json" + AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }} + VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}' jobs: build: @@ -141,3 +144,16 @@ jobs: with: name: NugetPackages.Artifacts path: ${{ github.workspace }}/Ed-Fi-ODS-Implementation/NugetPackages/*.nupkg + - name: Install-credential-handler + run: iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx" + shell: pwsh + - name: Publish to Azure Artifacts + working-directory: ./Ed-Fi-ODS-Implementation/ + run: | + Get-ChildItem "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/NugetPackages/" -Filter *.nupkg | + Foreach-Object { + Write-Host "nupkg full path is " $_.FullName + $packagePath = $_.FullName + dotnet nuget push $packagePath --api-key ${{ env.AZURE_ARTIFACT_NUGET_KEY }} --source ${{env.AZURE_ARTIFACT_URL}} --skip-duplicate + } + shell: pwsh From 859318a6cb6e3c166e2a27d1e7dc4a5554760f82 Mon Sep 17 00:00:00 2001 From: "m.semalaiappan" Date: Thu, 22 Jun 2023 16:13:23 -0500 Subject: [PATCH 4/8] Encrypt=False added for ConnectionStrings --- Application/EdFi.Ods.WebApi/appsettings.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Application/EdFi.Ods.WebApi/appsettings.json b/Application/EdFi.Ods.WebApi/appsettings.json index 25162c99e..100254205 100644 --- a/Application/EdFi.Ods.WebApi/appsettings.json +++ b/Application/EdFi.Ods.WebApi/appsettings.json @@ -5,12 +5,12 @@ "Default": "Warning" } }, - "ConnectionStrings": { - "EdFi_Ods": "Server=(local); Database=EdFi_{0}; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;", - "EdFi_Admin": "Server=(local); Database=EdFi_Admin; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;", - "EdFi_Security": "Server=(local); Database=EdFi_Security; Trusted_Connection=True; Persist Security Info=True; Application Name=EdFi.Ods.WebApi;", - "EdFi_Master": "Server=(local); Database=master; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;" - }, + "ConnectionStrings": { + "EdFi_Ods": "Server=(local); Database=EdFi_{0}; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;Encrypt=False", + "EdFi_Admin": "Server=(local); Database=EdFi_Admin; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;Encrypt=False", + "EdFi_Security": "Server=(local); Database=EdFi_Security; Trusted_Connection=True; Persist Security Info=True; Application Name=EdFi.Ods.WebApi;Encrypt=False", + "EdFi_Master": "Server=(local); Database=master; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;Encrypt=False" + }, "AllowedHosts": "*", "BearerTokenTimeoutMinutes": "30", "DefaultPageSizeLimit": 500, From 9f545b15fd4ddc10e1236cb7af77d2041cb644a9 Mon Sep 17 00:00:00 2001 From: "m.semalaiappan" Date: Thu, 22 Jun 2023 16:37:40 -0500 Subject: [PATCH 5/8] Encrypt=False change -Reverted Back --- Application/EdFi.Ods.WebApi/appsettings.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Application/EdFi.Ods.WebApi/appsettings.json b/Application/EdFi.Ods.WebApi/appsettings.json index 100254205..25162c99e 100644 --- a/Application/EdFi.Ods.WebApi/appsettings.json +++ b/Application/EdFi.Ods.WebApi/appsettings.json @@ -5,12 +5,12 @@ "Default": "Warning" } }, - "ConnectionStrings": { - "EdFi_Ods": "Server=(local); Database=EdFi_{0}; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;Encrypt=False", - "EdFi_Admin": "Server=(local); Database=EdFi_Admin; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;Encrypt=False", - "EdFi_Security": "Server=(local); Database=EdFi_Security; Trusted_Connection=True; Persist Security Info=True; Application Name=EdFi.Ods.WebApi;Encrypt=False", - "EdFi_Master": "Server=(local); Database=master; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;Encrypt=False" - }, + "ConnectionStrings": { + "EdFi_Ods": "Server=(local); Database=EdFi_{0}; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;", + "EdFi_Admin": "Server=(local); Database=EdFi_Admin; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;", + "EdFi_Security": "Server=(local); Database=EdFi_Security; Trusted_Connection=True; Persist Security Info=True; Application Name=EdFi.Ods.WebApi;", + "EdFi_Master": "Server=(local); Database=master; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi;" + }, "AllowedHosts": "*", "BearerTokenTimeoutMinutes": "30", "DefaultPageSizeLimit": 500, From 3419fc2da8fdd7ffe058d31ba246369ead9c04a1 Mon Sep 17 00:00:00 2001 From: "m.semalaiappan" Date: Thu, 22 Jun 2023 16:39:42 -0500 Subject: [PATCH 6/8] Publish to Azure Artifacts Step - Removed --- ...ev,Unit tests,Integration tests,Package.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml b/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml index 044b597a1..7537364ed 100644 --- a/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml +++ b/.github/workflows/InitDev,Unit tests,Integration tests,Package.yml @@ -25,9 +25,6 @@ env: REPOSITORY_DISPATCH_BRANCH: ${{ github.event.client_payload.branch }} EDFI_SUITE_NUMBER: "Suite3" msbuild_buildConfiguration: "release" - AZURE_ARTIFACT_URL: "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json" - AZURE_ARTIFACT_NUGET_KEY: ${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }} - VSS_NUGET_EXTERNAL_FEED_ENDPOINTS : '{"endpointCredentials": [{"endpoint": "https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json","password": "${{ secrets.AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN }}"}]}' jobs: build: @@ -143,17 +140,4 @@ jobs: uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 with: name: NugetPackages.Artifacts - path: ${{ github.workspace }}/Ed-Fi-ODS-Implementation/NugetPackages/*.nupkg - - name: Install-credential-handler - run: iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx" - shell: pwsh - - name: Publish to Azure Artifacts - working-directory: ./Ed-Fi-ODS-Implementation/ - run: | - Get-ChildItem "$env:GITHUB_WORKSPACE/Ed-Fi-ODS-Implementation/NugetPackages/" -Filter *.nupkg | - Foreach-Object { - Write-Host "nupkg full path is " $_.FullName - $packagePath = $_.FullName - dotnet nuget push $packagePath --api-key ${{ env.AZURE_ARTIFACT_NUGET_KEY }} --source ${{env.AZURE_ARTIFACT_URL}} --skip-duplicate - } - shell: pwsh + path: ${{ github.workspace }}/Ed-Fi-ODS-Implementation/NugetPackages/*.nupkg From ce55c0d6156e3aba93e4cced03a2177882c3b577 Mon Sep 17 00:00:00 2001 From: Jon Hickam Date: Tue, 12 Sep 2023 16:48:20 +0000 Subject: [PATCH 7/8] Initial profile project from jon, built on 6.1 patch2 --- Application/Ed-Fi-Ods.sln | 7 ++++ .../EdFi.Ods.Profiles.Dps.csproj | 34 +++++++++++++++++++ .../Marker_EdFi_Ods_Profiles_Dps.cs | 5 +++ .../EdFi.Ods.Profiles.Dps/Profiles.xml | 23 +++++++++++++ .../assemblyMetadata.json | 4 +++ .../EdFi.Ods.WebApi/EdFi.Ods.WebApi.csproj | 1 + 6 files changed, 74 insertions(+) create mode 100644 Application/EdFi.Ods.Profiles.Dps/EdFi.Ods.Profiles.Dps.csproj create mode 100644 Application/EdFi.Ods.Profiles.Dps/Marker_EdFi_Ods_Profiles_Dps.cs create mode 100644 Application/EdFi.Ods.Profiles.Dps/Profiles.xml create mode 100644 Application/EdFi.Ods.Profiles.Dps/assemblyMetadata.json diff --git a/Application/Ed-Fi-Ods.sln b/Application/Ed-Fi-Ods.sln index aebd58a7b..2875e1d89 100644 --- a/Application/Ed-Fi-Ods.sln +++ b/Application/Ed-Fi-Ods.sln @@ -93,6 +93,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EdFi.Ods.Api.IntegrationTes EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EdFi.Ods.Features.UnitTests", "..\..\Ed-Fi-ODS\tests\EdFi.Ods.Features.UnitTests\EdFi.Ods.Features.UnitTests.csproj", "{CBEDAB3E-3182-41D6-9C87-D2B4B426FBC7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EdFi.Ods.Profiles.Dps", "EdFi.Ods.Profiles.Dps\EdFi.Ods.Profiles.Dps.csproj", "{5A352475-2846-49EB-9F52-B64218203925}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -203,6 +205,10 @@ Global {CBEDAB3E-3182-41D6-9C87-D2B4B426FBC7}.Debug|Any CPU.Build.0 = Debug|Any CPU {CBEDAB3E-3182-41D6-9C87-D2B4B426FBC7}.Release|Any CPU.ActiveCfg = Release|Any CPU {CBEDAB3E-3182-41D6-9C87-D2B4B426FBC7}.Release|Any CPU.Build.0 = Release|Any CPU + {5A352475-2846-49EB-9F52-B64218203925}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5A352475-2846-49EB-9F52-B64218203925}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5A352475-2846-49EB-9F52-B64218203925}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5A352475-2846-49EB-9F52-B64218203925}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -236,6 +242,7 @@ Global {538782E7-25DC-494D-902D-3EE2EC839DC6} = {26FBA24F-2F1E-47EA-BDE2-EF57AE81D65D} {3ED34C57-BFEF-4FA1-9497-28D7D611D1B9} = {3AD03A98-4A2C-42F1-997D-2468A0CCB77D} {CBEDAB3E-3182-41D6-9C87-D2B4B426FBC7} = {14352B5E-2434-4117-A063-2BBD4D87464D} + {5A352475-2846-49EB-9F52-B64218203925} = {6B596494-5C35-4A04-93A8-13B21EBF9910} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {91F27EA2-CFF0-4054-A019-B8AA23AF9319} diff --git a/Application/EdFi.Ods.Profiles.Dps/EdFi.Ods.Profiles.Dps.csproj b/Application/EdFi.Ods.Profiles.Dps/EdFi.Ods.Profiles.Dps.csproj new file mode 100644 index 000000000..87d8ee732 --- /dev/null +++ b/Application/EdFi.Ods.Profiles.Dps/EdFi.Ods.Profiles.Dps.csproj @@ -0,0 +1,34 @@ + + + net6.0 + EdFi.Ods.Profiles.Dps + EdFi.Ods.Profiles.Dps + true + true + + + DEBUG;TRACE + full + true + + + + + + + + + True + True + + + + + + + + + + + + diff --git a/Application/EdFi.Ods.Profiles.Dps/Marker_EdFi_Ods_Profiles_Dps.cs b/Application/EdFi.Ods.Profiles.Dps/Marker_EdFi_Ods_Profiles_Dps.cs new file mode 100644 index 000000000..e62d00db9 --- /dev/null +++ b/Application/EdFi.Ods.Profiles.Dps/Marker_EdFi_Ods_Profiles_Dps.cs @@ -0,0 +1,5 @@ +namespace EdFi.Ods.Profiles.Dps +{ + // TODO: Rename this interface to match the marker interface convention + public interface Marker_EdFi_Ods_Profiles_Dps { } +} diff --git a/Application/EdFi.Ods.Profiles.Dps/Profiles.xml b/Application/EdFi.Ods.Profiles.Dps/Profiles.xml new file mode 100644 index 000000000..cbaff07c0 --- /dev/null +++ b/Application/EdFi.Ods.Profiles.Dps/Profiles.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Application/EdFi.Ods.Profiles.Dps/assemblyMetadata.json b/Application/EdFi.Ods.Profiles.Dps/assemblyMetadata.json new file mode 100644 index 000000000..3a3d1f14c --- /dev/null +++ b/Application/EdFi.Ods.Profiles.Dps/assemblyMetadata.json @@ -0,0 +1,4 @@ +{ + "assemblyModelType": "profile", + "assemblyMetadataFormatVersion": "1.0.0" +} \ No newline at end of file diff --git a/Application/EdFi.Ods.WebApi/EdFi.Ods.WebApi.csproj b/Application/EdFi.Ods.WebApi/EdFi.Ods.WebApi.csproj index 6750d3c0d..729470e90 100644 --- a/Application/EdFi.Ods.WebApi/EdFi.Ods.WebApi.csproj +++ b/Application/EdFi.Ods.WebApi/EdFi.Ods.WebApi.csproj @@ -44,6 +44,7 @@ + From 572cf55e8ea7608453af57e73c2adba3da571bcc Mon Sep 17 00:00:00 2001 From: Max Paulson <39929570+NovaLogicDev@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:14:27 +0000 Subject: [PATCH 8/8] added class period profiles --- .../EdFi.Ods.Profiles.Dps/Profiles.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Application/EdFi.Ods.Profiles.Dps/Profiles.xml b/Application/EdFi.Ods.Profiles.Dps/Profiles.xml index cbaff07c0..b8a17e9c7 100644 --- a/Application/EdFi.Ods.Profiles.Dps/Profiles.xml +++ b/Application/EdFi.Ods.Profiles.Dps/Profiles.xml @@ -12,6 +12,17 @@ + + + + + + + + + + + @@ -20,4 +31,12 @@ + + + + + + + + \ No newline at end of file