Skip to content

Commit

Permalink
Add environment variables and UI panel final modifiers
Browse files Browse the repository at this point in the history
This commit updates the deployment workflow to use new environment variables for signing the plugin. It also refactors UI code in `JKSView.java` to make some panel fields final and removes redundant labels. The changes streamline the signing process and enhance code clarity.
  • Loading branch information
cortiz committed Sep 6, 2024
1 parent 1ba536e commit e40154a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/deploy-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,8 @@ jobs:
run: ./gradlew publishPlugin
env:
PLUGIN_REPO: ${{ secrets.PLUGIN_REPO }}
PLUGIN_TOKEN: ${{ secrets.PLUGIN_TOKEN }}
CERTIFICATE_CHAIN: ${{ secrets.CERTIFICATE_CHAIN }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
PRIVATE_KEY_PASSWORD: ${{ secrets.PRIVATE_KEY_PASSWORD }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
CHANNEL: alpha
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ tasks {
}

signPlugin {
certificateChainFile.set(file("chain.crt"))
privateKeyFile.set(file("private.pem"))
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
privateKey.set(System.getenv("PRIVATE_KEY"))
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
}

Expand Down
14 changes: 5 additions & 9 deletions src/main/java/com/jmpeax/ssltoolbox/jks/JKSView.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class JKSView extends JPanel {
private JBList<String> list;
private PemView pemView;
private final VirtualFile file;
private JPanel listPanel;
private JPanel pemViewPanel;
private final JPanel listPanel;
private final JPanel pemViewPanel;
private JBPasswordField passwordField;

public JKSView(@NotNull VirtualFile file) {
Expand Down Expand Up @@ -75,19 +75,15 @@ private void loadPemView(X509Certificate certificate) {

private JPanel createListPanel() {
JPanel panel = new JPanel(new BorderLayout());
JLabel label = new JLabel("Certificate List", SwingConstants.CENTER);
JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
labelPanel.add(label);
panel.add(labelPanel, BorderLayout.NORTH);
panel.add(new JScrollPane(list), BorderLayout.CENTER);
return panel;
}

private JPanel createPemViewPanel() {
JPanel panel = new JPanel(new BorderLayout());
JLabel label = new JLabel("Certificate Details");
panel.add(label, BorderLayout.NORTH);
panel.add(new JPanel(), BorderLayout.CENTER); // Placeholder for PemView
panel.add(new JPanel(), BorderLayout.CENTER);
return panel;
}

Expand Down Expand Up @@ -137,8 +133,8 @@ private JPanel createUnlockButton() {
var certs = CertificateHelper.getKeyStoreCerts(file.getInputStream(), password);
updateView(certs);
// Remove the unlock button
//panel.removeAll();
// panel.add(buildToolBar());
panel.removeAll();
panel.add(buildToolBar());
revalidate();
repaint();
} catch (IOException ex) {
Expand Down

0 comments on commit e40154a

Please sign in to comment.