Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename AdminDomains to PrivilegedUserDomains #292

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Deployment/templates/continuous-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
value: $(essConfig-aioExcludeEncs)
- name: essConfig.apiUiUrl
value: $(essConfig-apiUiUrl)
- name: essConfig.adminDomains
value: $(essConfig-AdminDomains)
- name: essConfig.privilegedUserDomains
value: $(essConfig-PrivilegedUserDomains)
strategy:
runOnce:
deploy:
Expand Down
11 changes: 11 additions & 0 deletions NVDSuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,15 @@
<packageUrl regex="true">^pkg:npm/webpack@.*$</packageUrl>
<cve>CVE-2024-43788</cve>
</suppress>
<suppress>
<notes>
<![CDATA[
file name: cookie:0.6.0
Suppressed until angular upgrade.
]]>
</notes>
<packageUrl regex="true">^pkg:npm/cookie@.*$</packageUrl>
<vulnerabilityName>CVE-2024-47764</vulnerabilityName>
<vulnerabilityName>GHSA-pxg6-pf52-xh8x</vulnerabilityName>
</suppress>
</suppressions>
2 changes: 1 addition & 1 deletion Tests/UnitTests/fss-header.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('FssHeaderComponent', () => {

test('should set isPrivilegedUser to true for admin domains', () => {
component = new FssHeaderComponent(msalGuardConfiguration, msalService, route, msalBroadcastServie, analyticsService, signInButtonService,essUploadFileService);
component.configAdminDomains = ["test.com","abcd.com"];
component.configPrivilegedUserDomains = ["test.com","abcd.com"];
const claims = {
email: "admin@test.com"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class FssHeaderComponent implements OnInit, AfterViewInit, OnDestroy {
isActive: boolean = false;
fssSilentTokenRequest: SilentRequest;
fssTokenScope: any = [];
configAdminDomains: string[];
configPrivilegedUserDomains: string[];
constructor(@Inject(MSAL_GUARD_CONFIG) private msalGuardConfig: MsalGuardConfiguration,
private msalService: MsalService,
private route: Router,
Expand All @@ -46,7 +46,7 @@ export class FssHeaderComponent implements OnInit, AfterViewInit, OnDestroy {
private essUploadFileService: EssUploadFileService) {

this.fssTokenScope = AppConfigService.settings["fssConfig"].apiScope;
this.configAdminDomains = AppConfigService.settings["essConfig"].adminDomains;
this.configPrivilegedUserDomains = AppConfigService.settings["essConfig"].privilegedUserDomains;
this.fssSilentTokenRequest = {
scopes: [this.fssTokenScope],
};
Expand Down Expand Up @@ -191,8 +191,8 @@ export class FssHeaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.signedInName = this.userName;

const email = claims ? claims['email'] : null;
this.configAdminDomains.forEach(configAdminDomain => {
if (email && (email.toLowerCase().endsWith(configAdminDomain.toLowerCase()))) {
this.configPrivilegedUserDomains.forEach(configPrivilegedUserDomain => {
if (email && (email.toLowerCase().endsWith(configPrivilegedUserDomain.toLowerCase()))) {
this.essUploadFileService.isPrivilegedUser = true;
}
})
Expand Down
2 changes: 1 addition & 1 deletion src/assets/config/appconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@
"defaultEstimatedSizeinMB": "0.5",
"aioExcludeEncs": [ "GB800002", "FR800002" ],
"apiUiUrl": "",
"adminDomains":[]
"privilegedUserDomains": []
}
}
Loading