Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for GetDefaultExpiration (0.27 sec)

  1. internal/config/identity/openid/openid.go

    	for _, p := range r.arnProviderCfgsMap {
    		if p.RolePolicy != "" {
    			return r.roleArnPolicyMap
    		}
    	}
    	return nil
    }
    
    // GetDefaultExpiration - returns the expiration seconds expected.
    func GetDefaultExpiration(dsecs string) (time.Duration, error) {
    	timeout := env.Get(config.EnvMinioStsDuration, "")
    	defaultExpiryDuration, err := time.ParseDuration(timeout)
    	if err != nil {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  2. internal/config/identity/openid/jwt_test.go

    			duration: time.Duration(901) * time.Second,
    		},
    	}
    
    	for i, testCase := range testCases {
    		u, err := url.Parse(testCase.reqURL)
    		if err != nil {
    			t.Fatal(err)
    		}
    		d, err := GetDefaultExpiration(u.Query().Get("DurationSeconds"))
    		gotErr := (err != nil)
    		if testCase.expectErr != gotErr {
    			t.Errorf("Test %d: Expected %v, got %v with error %s", i+1, testCase.expectErr, gotErr, err)
    		}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  3. internal/config/identity/openid/jwt.go

    	if dsecs == "" {
    		return nil
    	}
    
    	if _, err := auth.ExpToInt64(expStr); err != nil {
    		return err
    	}
    
    	defaultExpiryDuration, err := GetDefaultExpiration(dsecs)
    	if err != nil {
    		return err
    	}
    
    	claims["exp"] = time.Now().UTC().Add(defaultExpiryDuration).Unix() // update with new expiry.
    	return nil
    }
    
    const (
    	audClaim = "aud"
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu May 30 18:10:41 UTC 2024
    - 8.3K bytes
    - Viewed (0)
  4. cmd/sts-handlers.go

    		return
    	}
    
    	if err := claims.populateSessionPolicy(r.Form); err != nil {
    		writeSTSErrorResponse(ctx, w, ErrSTSInvalidParameterValue, err)
    		return
    	}
    
    	duration, err := openid.GetDefaultExpiration(r.Form.Get(stsDurationSeconds))
    	if err != nil {
    		writeSTSErrorResponse(ctx, w, ErrSTSInvalidParameterValue, err)
    		return
    	}
    
    	claims[expClaim] = UTCNow().Add(duration).Unix()
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Jun 11 03:13:30 UTC 2024
    - 33.9K bytes
    - Viewed (0)
Back to top