Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support signed embed urls during backend session creation #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export class EmbedClient<T> {
navigation_token,
navigation_token_ttl,
session_reference_token_ttl,
signed_embed_url,
} = await this.acquireSession()
if (!authentication_token || !navigation_token || !api_token) {
throw new Error('failed to prepare cookieless embed session')
Expand All @@ -299,6 +300,9 @@ export class EmbedClient<T> {
this._cookielessNavigationToken = navigation_token
this._cookielessNavigationTokenTtl = navigation_token_ttl
this._cookielessSessionReferenceTokenTtl = session_reference_token_ttl
if (signed_embed_url) {
return signed_embed_url
}
const apiHost = `https://${this._builder.apiHost}`
const sep =
new URL(this._builder.embedUrl, apiHost).search === '' ? '?' : '&'
Expand Down
7 changes: 7 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ export interface LookerEmbedCookielessSessionData {
* Session time to live in seconds.
*/
session_reference_token_ttl?: number | null

/**
* Backend generated embed url for sessions with access to an exclusive component.
* For when using callback methods that inject additional information for session creation.
* If present, this value bypasses local url generation.
*/
signed_embed_url?: string | null
}

/**
Expand Down