box / box/box-java-sdk

Expose additional BoxAPIRequest/BoxAPIConnection members for request intercept use case

Abierto
#488 3 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Java
Estrellas
170
Forks
189
Merge medio
20 h 26 min
PR fusionados (30 d)
22

Descripción

In a Box SDK integration, I implemented a `com.box.sdk.RequestInterceptor` that uses its own HTTP client to send the requests over the network. Doing that, I noticed that in order to support this scenario, certain members should, in my opinion, be exposed to clients outside the SDK:
- `com.box.sdk.BoxAPIRequest.getHeaders()` should be public so that the corresponding content is accessible
- `com.box.sdk.BoxAPIRequest.shouldAuthenticate` should be exposed via a getter to distinguish the two cases that it indicates

In order to hold a read lock on the access token during the request (as `com.box.sdk.BoxAPIRequest.trySend(ProgressListener)` does), it would be necessary to also expose
- `com.box.sdk.BoxAPIConnection.lockAccessToken()` and
- `com.box.sdk.BoxAPIConnection.unlockAccessToken()`.

The access token can be obtained with the (already public) method `com.box.sdk.BoxAPIConnection.getAccessToken()`, but in this case there is no lock and the access token could be invalidated before the HTTP request is sent (or while it is being sent).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.