question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion: Request context information

See original GitHub issue

I’d like to add the ability of a Request or maybe Call to carry some additional contextual information. I’m curious if this has been considered before. Or any thoughts for how to approach this, e.g. an immutable Map on Request.

I’m bastardising request.tag in my own project to carry an optional auth token or “pointer”.

https://github.com/yschimke/oksocial/blob/6b8025dc3a53623e3b49d041ef36037961ae0c23/src/main/kotlin/com/baulsupp/oksocial/credentials/TokenSet.kt

sealed class Token {
  open fun name(): String? = null
}

val DefaultToken = TokenSet("default")

data class TokenSet(val name: String) : Token() {
  override fun name(): String? = name
}

data class TokenValue(val token: Any) : Token()

object NoToken : Token()

Used to override the auth token that a preregistered authenticator should use e.g. None, Default, “Work”, “Accounts”, “Personal”, or even a programmatically provided one.

e.g.

    val response = client.query<Oauth2TokenResponse>(request("https://connect.squareup.com/oauth2/token", NoToken) {
      postJsonBody(AuthDetails(clientId, clientSecret, code, s.redirectUri))
    })

This works, but I’m fighting the OkHttp library to do it. It is terrible example code I can’t show anybody.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
swankjessecommented, Jun 1, 2018
0reactions
yschimkecommented, Jun 1, 2018

I’ll update the comments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The suggestion request object - Sitecore Documentation
Describes the structure and properties of the suggestion object in a Sitecore Discover Search and Recommendation request.
Read more >
How to Make Subtle Requests and Suggestions Using ...
Learn how to make subtle requests and suggestions using implicature. We talk about the phenomenon in pragmatics called implicature and the purpose of ......
Read more >
Suggester | Apache Solr Reference Guide 8.1
The SuggestComponent in Solr provides users with automatic suggestions for query terms. You can use this to implement a powerful auto-suggest feature in...
Read more >
Context Clusters in Search Query Suggestions - SEO by the Sea
Google may use context clusters (or topics) to find query suggestions before a searcher has completed typing in a full query.
Read more >
Suggesters | Elasticsearch Guide [8.5] | Elastic
The category context allows you to associate one or more categories with suggestions at index time. At query time, suggestions can be filtered...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found