Skip to content

Commit

Permalink
feat(NET-584): session mgmt for RAC
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceix committed Sep 19, 2023
1 parent 68a754d commit c69b4f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion logic/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
const timer_hours_between_runs = 24

// HookManagerCh - channel to add any new hooks
var HookManagerCh = make(chan models.HookDetails, 2)
var HookManagerCh = make(chan models.HookDetails, 3)

// == Public ==

Expand Down
2 changes: 1 addition & 1 deletion pro/remote_access_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func racAutoDisableHook() error {
continue
}
for _, client := range clients {
if client.OwnerID == user.UserName {
if client.OwnerID == user.UserName && client.Enabled {
slog.Info(fmt.Sprintf("disabling ext client %s for user %s due to RAC autodisabling", client.ClientID, client.OwnerID))
if err := disableExtClient(&client); err != nil {
slog.Error("error disabling ext client in RAC autodisable hook", "error", err)
Expand Down
4 changes: 2 additions & 2 deletions servercfg/serverconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ func GetServerConfig() config.ServerConfig {

// GetJwtValidityDuration - returns the JWT validity duration in seconds
func GetJwtValidityDuration() time.Duration {
var defaultDuration = time.Duration(24 * time.Hour)
var defaultDuration = time.Duration(24) * time.Hour
if os.Getenv("JWT_VALIDITY_DURATION") != "" {
t, err := strconv.Atoi(os.Getenv("JWT_VALIDITY_DURATION"))
if err != nil {
return defaultDuration
}
return time.Duration(t)
return time.Duration(t) * time.Second
}
return defaultDuration
}
Expand Down

0 comments on commit c69b4f3

Please sign in to comment.