8000 NAS-136443 / 25.10 / WebUI should allow adding certificates without including … by undsoft · Pull Request #12178 · truenas/webui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NAS-136443 / 25.10 / WebUI should allow adding certificates without including … #12178

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

Merged
merged 1 commit into from
Jun 26, 2025
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
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Bash(npx tsc:*)",
"Bash(yarn ui remote:*)",
"Bash(yarn eslint:*)",
"Bash(ls *)",
"Bash(ls:*)",
"Bash(find *)",
"Bash(sed *)",
"Bash(git add:*)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,28 @@ describe('ImportCertificateComponent', () => {
expect(spectator.inject(SnackbarService).success).toHaveBeenCalled();
expect(spectator.inject(SlideInRef).close).toHaveBeenCalledWith({ response: true });
});

it('imports certificate with empty private key', async () => {
await form.fillForm({
Name: 'test-cert-no-private-key',
'Add To Trusted Store': false,
Certificate: '--BEING CERTIFICATE--',
'Private Key': '',
});

const importButton = await loader.getHarness(MatButtonHarness.with({ text: 'Import' }));
await importButton.click();

expect(spectator.inject(ApiService).job).toHaveBeenCalledWith('certificate.create', [{
name: 'test-cert-no-private-key',
add_to_trusted_store: false,
certificate: '--BEING CERTIFICATE--',
privatekey: undefined,
passphrase: null,
create_type: CertificateCreateType.Import,
}]);

expect(spectator.inject(SnackbarService).success).toHaveBeenCalled();
expect(spectator.inject(SlideInRef).close).toHaveBeenCalledWith({ response: true });
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export class ImportCertificateComponent {
...omit(this.form.getRawValue(), ['passphrase2']),
create_type: CertificateCreateType.Import,
passphrase: this.form.controls.passphrase.value || null,
privatekey: this.form.controls.privatekey.value || undefined,
};
}
}
Loading
0