Skip to content

Commit

Permalink
Store and expose locale ids from Session in case something like an at…
Browse files Browse the repository at this point in the history
…tribute getter wants it.
  • Loading branch information
locka99 committed Mar 31, 2020
1 parent 185bb9c commit e49f34f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/src/services/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ impl SessionService {
session.set_activated(true);
session.set_session_nonce(server_nonce);
session.set_user_identity(IdentityToken::new(&request.user_identity_token, &server_state.decoding_limits()));
session.set_locale_ids(request.locale_ids.clone());

let diagnostic_infos = None;

Expand Down
12 changes: 12 additions & 0 deletions server/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ pub struct Session {
session_timeout: f64,
/// User identity token
user_identity: IdentityToken,
/// Session's preferred locale ids
locale_ids: Option<Vec<UAString>>,
/// Negotiated max request message size
max_request_message_size: u32,
/// Negotiated max response message size
Expand Down Expand Up @@ -118,6 +120,7 @@ impl Session {
session_nonce: ByteString::null(),
session_timeout: 0f64,
user_identity: IdentityToken::None,
locale_ids: None,
max_request_message_size: 0,
max_response_message_size: 0,
endpoint_url: UAString::null(),
Expand Down Expand Up @@ -160,6 +163,7 @@ impl Session {
session_nonce: ByteString::null(),
session_timeout: 0f64,
user_identity: IdentityToken::None,
locale_ids: None,
max_request_message_size: 0,
max_response_message_size: 0,
endpoint_url: UAString::null(),
Expand Down Expand Up @@ -230,6 +234,14 @@ impl Session {
self.user_identity = user_identity;
}

pub fn locale_ids(&self) -> &Option<Vec<UAString>> {
&self.locale_ids
}

pub fn set_locale_ids(&mut self, locale_ids: Option<Vec<UAString>>) {
self.locale_ids = locale_ids;
}

pub fn client_certificate(&self) -> &Option<X509> {
&self.client_certificate
}
Expand Down

0 comments on commit e49f34f

Please sign in to comment.