mirror of
https://github.com/openziti/ziti.git
synced 2026-10-14 08:10:17 +00:00
Merge pull request #770 from openziti/fix-mfa-panic
Fix panic if posture data mfa is nil
This commit is contained in:
@@ -91,9 +91,10 @@ func (r *PostureResponseRouter) CreateBulk(ae *env.AppEnv, rc *response.RequestC
|
||||
postureData := ae.Handlers.PostureResponse.PostureData(rc.Identity.Id)
|
||||
|
||||
if postureData != nil && postureData.ApiSessions != nil {
|
||||
if apiPostureData, ok := postureData.ApiSessions[rc.ApiSession.Id]; ok && apiPostureData.Mfa.PassedMfaAt != nil {
|
||||
apiPostureData := postureData.ApiSessions[rc.ApiSession.Id]
|
||||
if passedMfaAt := apiPostureData.GetPassedMfaAt(); passedMfaAt != nil {
|
||||
//if the last time Mfa was passed at is outside of the grace period, send timeout update
|
||||
durationSinceLastMfa := time.Now().Sub(*apiPostureData.Mfa.PassedMfaAt)
|
||||
durationSinceLastMfa := time.Now().Sub(*passedMfaAt)
|
||||
|
||||
modelServicesWithTimeouts := ae.Handlers.PostureResponse.GetEndpointStateChangeAffectedServices(durationSinceLastMfa, gracePeriod, onWake, onUnlock)
|
||||
|
||||
|
||||
@@ -388,6 +388,13 @@ type ApiSessionPostureData struct {
|
||||
SdkInfo *SdkInfo
|
||||
}
|
||||
|
||||
func (self *ApiSessionPostureData) GetPassedMfaAt() *time.Time {
|
||||
if self == nil || self.Mfa == nil {
|
||||
return nil
|
||||
}
|
||||
return self.Mfa.PassedMfaAt
|
||||
}
|
||||
|
||||
type PostureCheckFailureSubType interface {
|
||||
Value() interface{}
|
||||
Expected() interface{}
|
||||
|
||||
Reference in New Issue
Block a user