Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3525971
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/lib/utils/services-utils.js b/lib/utils/services-utils.js
index 944de0684..cee931d32 100644
--- a/lib/utils/services-utils.js
+++ b/lib/utils/services-utils.js
@@ -1,58 +1,58 @@
// @flow
import base64 from 'base-64';
import type { AuthMetadata } from '../shared/identity-client-context.js';
// If this is true then we're using the identity service for auth. After we
// auth, the identity service gives us a CSAT, which we can use to auth with
// other Comm services.
-const usingCommServicesAccessToken = false;
+const usingCommServicesAccessToken = true;
// If this is true, then the app is able to support multiple keyservers. This
// requires the use of Tunnelbroker and the backup service to persist and sync
// the KeyserverStore.
const supportingMultipleKeyservers = false;
// If this is false, then the app no longer needs to rely on being connected to
// an authoritative keyserver for things like DMs.
const relyingOnAuthoritativeKeyserver = true;
// If this is true, then DM creation will use E2EE DMs encrypted via Olm and
// brokered by Tunnelbroker, instead of creating chats under GENESIS on the
// authoritative keyserver.
const usingOlmViaTunnelbrokerForDMs = false;
function handleHTTPResponseError(response: Response): void {
if (!response.ok) {
const { status, statusText } = response;
throw new Error(`Server responded with HTTP ${status}: ${statusText}`);
}
}
function createHTTPAuthorizationHeader(authMetadata: AuthMetadata): string {
// explicit destructure to make it future-proof
const { userID, deviceID, accessToken } = authMetadata;
const payload = JSON.stringify({ userID, deviceID, accessToken });
const base64EncodedPayload = base64.encode(payload);
return `Bearer ${base64EncodedPayload}`;
}
function createDefaultHTTPRequestHeaders(authMetadata: AuthMetadata): {
[string]: string,
} {
const authorization = createHTTPAuthorizationHeader(authMetadata);
return {
Authorization: authorization,
};
}
export {
handleHTTPResponseError,
usingCommServicesAccessToken,
supportingMultipleKeyservers,
relyingOnAuthoritativeKeyserver,
usingOlmViaTunnelbrokerForDMs,
createHTTPAuthorizationHeader,
createDefaultHTTPRequestHeaders,
};
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Wed, Dec 25, 7:00 PM (19 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694844
Default Alt Text
(2 KB)
Attached To
Mode
rCOMM Comm
Attached
Detach File
Event Timeline
Log In to Comment