Skip to content

Commit 542005c

Browse files
RamSubbaraoGitHub Enterprise
authored and
GitHub Enterprise
committed
Deprecate enviornment variables for setting passwords and use secrets (#639)
* deprecate environment variables and use secrets * Address review comments
1 parent c170ad3 commit 542005c

File tree

29 files changed

+508
-461
lines changed

29 files changed

+508
-461
lines changed

Dockerfile-server

+3-8
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,9 @@ ENTRYPOINT ["runmqserver"]
156156
# Use the Go toolset image, which already includes gcc and the MQ SDK
157157
FROM builder as cbuilder
158158
USER 0
159-
# Install the Apache Portable Runtime code (used for htpasswd hash checking)
160-
RUN yum --assumeyes --disableplugin=subscription-manager install apr-devel apr-util-openssl apr-util-devel
159+
# Install the Apache Portable Runtime code (used for simpleauth hash checking)
161160
COPY authservice/ /opt/app-root/src/authservice/
162-
WORKDIR /opt/app-root/src/authservice/mqhtpass
161+
WORKDIR /opt/app-root/src/authservice/mqsimpleauth
163162
RUN make all
164163

165164
###############################################################################
@@ -181,12 +180,8 @@ LABEL summary="IBM MQ Advanced for Developers Server" \
181180
base-image=$BASE_IMAGE \
182181
base-image-release=$BASE_TAG
183182
USER 0
184-
COPY --from=cbuilder /opt/app-root/src/authservice/mqhtpass/build/mqhtpass.so /opt/mqm/lib64/
183+
COPY --from=cbuilder /opt/app-root/src/authservice/mqsimpleauth/build/mqsimpleauth.so /opt/mqm/lib64/
185184
COPY etc/mqm/qm-service-component.ini.default /etc/mqm/
186-
COPY incubating/mqadvanced-server-dev/install-extra-packages.sh /usr/local/bin/
187-
RUN chmod u+x /usr/local/bin/install-extra-packages.sh \
188-
&& sleep 1 \
189-
&& install-extra-packages.sh
190185
COPY --from=builder $GO_WORKDIR/runmqdevserver /usr/local/bin/
191186
# Copy template files
192187
COPY incubating/mqadvanced-server-dev/*.tpl /etc/mqm/

authservice/mqhtpass/src/htpass.c

-145
This file was deleted.

authservice/mqhtpass/src/htpass_test.htpasswd

-2
This file was deleted.

authservice/mqhtpass/src/htpass_test_invalid.htpasswd

-3
This file was deleted.

authservice/mqhtpass/Makefile renamed to authservice/mqsimpleauth/Makefile

+10-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# - gcc
1717
# - ldd
1818
# - MQ SDK (mqm_r library, plus header files)
19-
# - Apache Portable Runtime (apr-1 and aprutil-1 libraries, plus header files)
2019

2120
SRC_DIR = src
2221
BUILD_DIR = ./build
@@ -30,10 +29,9 @@ CFLAGS.s390x := -m64
3029
CFLAGS.arm64 :=
3130
CFLAGS += -std=gnu11 -fPIC -Wall ${CFLAGS.${ARCH}}
3231

33-
LIB_APR = -L/usr/lib64 -lapr-1 -laprutil-1
3432
LIB_MQ = -L/opt/mqm/lib64 -lmqm_r
3533

36-
all: $(BUILD_DIR)/mqhtpass.so $(BUILD_DIR)/htpass_test $(BUILD_DIR)/log_test
34+
all: $(BUILD_DIR)/mqsimpleauth.so $(BUILD_DIR)/simpleauth_test $(BUILD_DIR)/log_test
3735

3836
$(BUILD_DIR)/log.o : $(SRC_DIR)/log.c $(SRC_DIR)/log.h
3937
mkdir -p ${dir $@}
@@ -42,21 +40,20 @@ $(BUILD_DIR)/log.o : $(SRC_DIR)/log.c $(SRC_DIR)/log.h
4240
$(BUILD_DIR)/log_test : $(BUILD_DIR)/log.o
4341
mkdir -p ${dir $@}
4442
gcc $(CFLAGS) $(SRC_DIR)/log_test.c $^ -o $@
45-
# Run Logging tests, and print log if they fail
43+
# Run Logging tests, and print log if they fail
4644
$@ || (cat log_test*.log && exit 1)
4745

48-
$(BUILD_DIR)/htpass.o : $(SRC_DIR)/htpass.c $(SRC_DIR)/htpass.h
46+
$(BUILD_DIR)/simpleauth.o : $(SRC_DIR)/simpleauth.c $(SRC_DIR)/simpleauth.h
4947
mkdir -p ${dir $@}
50-
gcc $(CFLAGS) -c $(SRC_DIR)/htpass.c -I /usr/include/apr-1 -o $@
48+
gcc $(CFLAGS) -c $(SRC_DIR)/simpleauth.c -o $@
5149

52-
$(BUILD_DIR)/htpass_test : $(BUILD_DIR)/htpass.o $(BUILD_DIR)/log.o
50+
$(BUILD_DIR)/simpleauth_test : $(BUILD_DIR)/simpleauth.o $(BUILD_DIR)/log.o
5351
mkdir -p ${dir $@}
54-
gcc $(CFLAGS) $(LIB_APR) -lpthread $(SRC_DIR)/htpass_test.c $^ -o $@
55-
# Run HTPasswd tests, and print log if they fail
56-
$@ || (cat htpass_test*.log && exit 1)
52+
gcc $(CFLAGS) -lpthread $(SRC_DIR)/simpleauth_test.c $^ -o $@
53+
# Run SimpleAuth tests, and print log if they fail
54+
$@ || (cat simpleauth_test*.log && exit 1)
5755

58-
$(BUILD_DIR)/mqhtpass.so : $(BUILD_DIR)/log.o $(BUILD_DIR)/htpass.o
56+
$(BUILD_DIR)/mqsimpleauth.so : $(BUILD_DIR)/log.o $(BUILD_DIR)/simpleauth.o
5957
mkdir -p ${dir $@}
60-
# NOTE: rpath for libapr will be different on Ubuntu
61-
gcc $(CFLAGS) -I/opt/mqm/inc -D_REENTRANT $(LIB_APR) $(LIB_MQ) -Wl,-rpath,/opt/mqm/lib64 -Wl,-rpath,/usr/lib64 -shared $(SRC_DIR)/mqhtpass.c $^ -o $@
58+
gcc $(CFLAGS) -I/opt/mqm/inc -D_REENTRANT $(LIB_MQ) -Wl,-rpath,/opt/mqm/lib64 -Wl,-rpath,/usr/lib64 -shared $(SRC_DIR)/mqsimpleauth.c $^ -o $@
6259
ldd $@

authservice/mqhtpass/src/log.c renamed to authservice/mqsimpleauth/src/log.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void log_printf(const char *source_file, int source_line, const char *level, con
134134
if (strncmp(level, "DEBUG", 5) == 0)
135135
{
136136
// Add a prefix on any debug messages
137-
cur += snprintf(cur, end-cur, "mqhtpass: ");
137+
cur += snprintf(cur, end-cur, "mqsimpleauth: ");
138138
}
139139

140140
// Print log message, using varargs
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fred:$2y$05$3Fp9

0 commit comments

Comments
 (0)