mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 16:47:32 +00:00
feat: add possibility to set an expiration to a session (#6851)
* add lifetime to session api * extend session with lifetime * check session token expiration * fix typo * integration test to check session token expiration * integration test to check session token expiration * i18n * cleanup * improve tests * prevent negative lifetime * fix error message * fix lifetime check
This commit is contained in:
@@ -40,6 +40,11 @@ message Session {
|
||||
}
|
||||
];
|
||||
UserAgent user_agent = 7;
|
||||
optional google.protobuf.Timestamp expiration_date = 8 [
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "\"time the session will be automatically invalidated\"";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
message Factors {
|
||||
|
@@ -10,6 +10,7 @@ import "zitadel/session/v2beta/session.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/api/field_behavior.proto";
|
||||
import "google/protobuf/struct.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "protoc-gen-openapiv2/options/annotations.proto";
|
||||
import "validate/validate.proto";
|
||||
|
||||
@@ -275,6 +276,12 @@ message CreateSessionRequest{
|
||||
];
|
||||
RequestChallenges challenges = 3;
|
||||
UserAgent user_agent = 4;
|
||||
optional google.protobuf.Duration lifetime = 5 [
|
||||
(validate.rules).duration = {gt: {seconds: 0}},
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "\"duration after which the session will be automatically invalidated\"";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
message CreateSessionResponse{
|
||||
@@ -322,6 +329,12 @@ message SetSessionRequest{
|
||||
}
|
||||
];
|
||||
RequestChallenges challenges = 5;
|
||||
optional google.protobuf.Duration lifetime = 6 [
|
||||
(validate.rules).duration = {gt: {seconds: 0}},
|
||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
|
||||
description: "\"duration after which the session will be automatically invalidated\"";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
message SetSessionResponse{
|
||||
|
Reference in New Issue
Block a user