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

Fixed the issue where some fields with '-' were inaccessible through plugin #21

Merged
merged 1 commit into from
Jan 10, 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: 4 additions & 0 deletions .changes/1.0.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 1.0.6 - 2024-01-10
### 🐛 Bug Fix

- Fixed the issue where some fields with '-' were inaccessible through the Jenkins plugin.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
## 1.0.6 - 2024-01-10
### 🐛 Bug Fix

- Fixed the issue where some fields with '-' were inaccessible through the Jenkins plugin.
## 1.0.5 - 2023-12-18
### 🐛 Bug Fix

Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tasks:
bump:
desc: bump the version using changie
cmds:
- changie batch 1.0.5
- changie batch 1.0.6
- changie merge
- git add .changes/*
- git add CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</parent>
<groupId>io.jenkins.plugins</groupId>
<artifactId>thycotic-secret-server</artifactId>
<version>1.0.5</version>
<version>1.0.6</version>
<packaging>hpi</packaging>
<properties>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
// Add each Secret Field Value with a corresponding mapping to the environment
secret.getFields().forEach(field -> {
serverSecret.getMappings().forEach(mapping -> {
if (mapping.getField().equalsIgnoreCase(field.getFieldName())) {
if (mapping.getField().equalsIgnoreCase(field.getFieldName()) || mapping.getField().equalsIgnoreCase(field.getSlug())) {

Check warning on line 106 in src/main/java/com/thycotic/secrets/jenkins/ServerBuildWrapper.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 106 is not covered by tests
// Prepend the the environment variable prefix
context.env(StringUtils.trimToEmpty(configuration.getEnvironmentVariablePrefix())
+ mapping.getEnvironmentVariable(), field.getValue());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public Mapping(final String environmentVariable, final String field) {

@Extension
public static final class DescriptorImpl extends Descriptor<Mapping> {
private static final String NAME_PATTERN = "[a-zA-Z_][a-zA-Z0-9]*";
private static final String NAME_PATTERN = "[a-zA-Z_-][a-zA-Z0-9 ]*";

@Override
public String getDisplayName() {
Expand Down
Loading