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

dependency updates and small ui fixes #30

Merged
merged 1 commit into from
Jan 15, 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 go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/go-jose/go-jose/v4 v4.0.4 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/in4it/go-devops-platform v0.1.1
github.com/in4it/go-devops-platform v0.1.2
github.com/russellhaering/gosaml2 v0.9.1 // indirect
github.com/russellhaering/goxmldsig v1.4.0 // indirect
)
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ github.com/in4it/go-devops-platform v0.1.1-0.20250115193241-b564ec1b674a h1:h1ra
github.com/in4it/go-devops-platform v0.1.1-0.20250115193241-b564ec1b674a/go.mod h1:uSlFttQ27jkCi49e+yQGyAHTKzNE/S0/Y2odk20xax0=
github.com/in4it/go-devops-platform v0.1.1 h1:6fAlKe5rmXPzJiEt+Qs3kbJHG8svxEA5ciOaZkrkl/I=
github.com/in4it/go-devops-platform v0.1.1/go.mod h1:oORoWkGLwJN7ekBkOFMx0UULKLk5gRSzlg2vw0kygtI=
github.com/in4it/go-devops-platform v0.1.2-0.20250115201601-98063b422db4 h1:Fak0Jb42NekaaRG48EC7SabiffueWVYr6Jcf++GAGTQ=
github.com/in4it/go-devops-platform v0.1.2-0.20250115201601-98063b422db4/go.mod h1:oORoWkGLwJN7ekBkOFMx0UULKLk5gRSzlg2vw0kygtI=
github.com/in4it/go-devops-platform v0.1.2-0.20250115203120-aab149ca8139 h1:6A5siej1whHDd1HrphnzAeCjShZHw6ZRFWqiANAJYA4=
github.com/in4it/go-devops-platform v0.1.2-0.20250115203120-aab149ca8139/go.mod h1:oORoWkGLwJN7ekBkOFMx0UULKLk5gRSzlg2vw0kygtI=
github.com/in4it/go-devops-platform v0.1.2 h1:zP38Onvc9226uK9utZn+873Mb5jzkYc7Ig5jjGn8D1o=
github.com/in4it/go-devops-platform v0.1.2/go.mod h1:oORoWkGLwJN7ekBkOFMx0UULKLk5gRSzlg2vw0kygtI=
github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8=
github.com/jonboulle/clockwork v0.4.0 h1:p4Cf1aMWXnXAUh8lVfewRBx1zaTSYKrKMF2g3ST4RZ4=
Expand Down
28 changes: 28 additions & 0 deletions pkg/vpn/router_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package vpn

import (
"io"
"net/http"
"net/http/httptest"
"testing"

"github.com/in4it/go-devops-platform/rest"
)

func TestIsAdmin(t *testing.T) {
handler := func(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "<html><body>Hello World!</body></html>")
}

req := httptest.NewRequest("GET", "http://example.com/foo", nil)
w := httptest.NewRecorder()

rest.IsAdminMiddleware(http.HandlerFunc(handler)).ServeHTTP(w, req)

resp := w.Result()

if resp.StatusCode != 403 {
t.Fatalf("expected permission denied")
}

}
39 changes: 22 additions & 17 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"date-fns": "^3.6.0",
"react": "^18.2.0",
"react-chartjs-2": "^5.2.0",
"react-cookie": "^7.1.4",
"react-cookie": "^7.2.2",
"react-dom": "^18.2.0",
"react-hook-qrcode-svg": "^1.5.1",
"react-icons": "^5.3.0",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/NavBar/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function Version() {
const { isPending, error, data } = useQuery({
queryKey: ['version'],
queryFn: () =>
fetch(AppSettings.url + '/version', {
fetch(AppSettings.url + '/vpn/version', {
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + authInfo.token
Expand Down
1 change: 1 addition & 0 deletions webapp/src/Routes/Connection/NewConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export function NewConnection() {
},
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: ['connections'] })
queryClient.invalidateQueries({ queryKey: ['connectionlicense'] })
},
onError: (error:AxiosError) => {
const errorMessage = error.response?.data as GenericErrorResponse
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/Routes/Users/ListUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export function ListUsers({localAuthDisabled}:Props) {
defaultValue={item.role}
variant="unstyled"
allowDeselect={false}
onChange={(event) => updateUser.mutate({...item, id: item.id, password: "", role: event === null ? "" : event})}
onChange={(event) => updateUser.mutate({...item, id: item.id, password: "", role: event === null ? "" : event, lastLogin: "0001-01-01T00:00:00Z"})}
/>
</Table.Td>
<Table.Td>
Expand Down
Loading
Loading