Skip to content

Commit

Permalink
Merge pull request #548 from openziti/reserve-ui-fixes
Browse files Browse the repository at this point in the history
Small reserver ui/ux fixes (#443, #531)
  • Loading branch information
michaelquigley authored Feb 14, 2024
2 parents 4dafe4a + df51d9b commit 6966596
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## v0.4.25

CHANGE: Update to share creation. Now checks for token collision and returns a relevant error. (https://github.com/openziti/zrok/issues/531)

CHANGE: Update UI to add a 'true' value on booleans. (https://github.com/openziti/zrok/issues/443)

## v0.4.24

FEATURE: New `socks` backend mode for use with private sharing. Use `zrok share private --backend-mode socks` and then `zrok access private` that share from somewhere else... very lightweight VPN-like functionality (https://github.com/openziti/zrok/issues/558)
Expand Down
10 changes: 10 additions & 0 deletions controller/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ func (h *shareHandler) Handle(params share.ShareParams, principal *rest_model_zr
sshr.FrontendEndpoint = &sshr.ShareMode
}

sh, err := str.FindShareWithToken(sshr.Token, trx)
if err != nil {
logrus.Errorf("error checking share for token collision: %v", err)
return share.NewShareInternalServerError()
}
if sh != nil {
logrus.Errorf("token '%v' already exists; cannot create share", sshr.Token)
return share.NewShareConflict()
}

sid, err := str.CreateShare(envId, sshr, trx)
if err != nil {
logrus.Errorf("error creating share record: %v", err)
Expand Down
62 changes: 62 additions & 0 deletions rest_client_zrok/share/share_responses.go

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

6 changes: 6 additions & 0 deletions rest_server_zrok/embedded_spec.go

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

25 changes: 25 additions & 0 deletions rest_server_zrok/operations/share/share_responses.go

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

2 changes: 2 additions & 0 deletions specs/zrok.yml
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,8 @@ paths:
description: unauthorized
404:
description: not found
409:
description: conflict
422:
description: unprocessable
500:
Expand Down
2 changes: 1 addition & 1 deletion ui/src/console/PropertyTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const rowToValue = (row) => {
if(row.property.endsWith("At")) {
return new Date(row.value).toLocaleString();
}
return row.value;
return row.value.toString();
};

const PropertyTable = (props) => {
Expand Down

0 comments on commit 6966596

Please sign in to comment.