Skip to content

Commit ac79bd2

Browse files
authored
Fix/defer close pid (#16)
* fix: ensure rod launched chromium instance is killed on every run * fix: error msg notes * fix: bump codeQL * fix: update Licence +semver: feat +semver: feature bumping minor
1 parent 81b8ef0 commit ac79bd2

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v1
45+
uses: github/codeql-action/init@v2
4646
with:
4747
languages: ${{ matrix.language }}
4848
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -53,7 +53,7 @@ jobs:
5353
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5454
# If this step fails, then you should remove it and run the build manually (see below)
5555
- name: Autobuild
56-
uses: github/codeql-action/autobuild@v1
56+
uses: github/codeql-action/autobuild@v2
5757

5858
# ℹ️ Command-line programs to run using the OS shell.
5959
# 📚 https://git.io/JvXDl
@@ -67,4 +67,4 @@ jobs:
6767
# make release
6868

6969
- name: Perform CodeQL Analysis
70-
uses: github/codeql-action/analyze@v1
70+
uses: github/codeql-action/analyze@v2

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 dnitsch
3+
Copyright (c) 2024 dnitsch
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LDFLAGS := -ldflags="-s -w -X \"github.com/$(OWNER)/$(NAME)/cmd.Version=$(VERSIO
99
.PHONY: test test_ci tidy install buildprep build buildmac buildwin
1010

1111
test: test_prereq
12-
go test ./... -v -mod=readonly -coverprofile=.coverage/out && \
12+
go test ./... -v -mod=readonly -coverprofile=.coverage/out -race && \
1313
cat .coverage/out | go-junit-report > .coverage/report-junit.xml && \
1414
gocov convert .coverage/out | gocov-xml > .coverage/report-cobertura.xml
1515

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ By default the tool creates the session name - which can be audited including th
4949

5050
- Prior to `v0.8.0` you might be need to manually kill the `aws-cli-auth` process manually from your OS's process manager.
5151

52-
## Licence
53-
54-
WFTPL
55-
5652
## Contribute
5753

5854
Contributions to the aws-auth-cli package are most welcome from engineers of all backgrounds and skill levels.

internal/web/web.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,17 @@ func (web *Web) GetSSOCredentials(conf credentialexchange.CredentialConfig) (str
171171
func (web *Web) MustClose() {
172172
err := web.browser.Close()
173173
if err != nil {
174-
fmt.Fprintf(os.Stderr, "%s", err)
174+
fmt.Fprintf(os.Stderr, "failed to close browser instance: %s", err)
175+
}
176+
pid := web.launcher.PID()
177+
proc, err := os.FindProcess(pid)
178+
if err != nil {
179+
fmt.Fprintf(os.Stderr, "failed to find launcher process(%d): %s", pid, err)
180+
}
181+
if proc != nil {
182+
if err := proc.Kill(); err != nil {
183+
fmt.Fprintf(os.Stderr, "failed to kill launcher process(%d): %s", pid, err)
184+
}
175185
}
176186
}
177187

0 commit comments

Comments
 (0)