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: documenting android proxy and get a token services #50

Merged
merged 6 commits into from
Jan 26, 2023
Merged

Conversation

jleon15
Copy link
Contributor

@jleon15 jleon15 commented Jan 25, 2023

Description

  • Document android create session, proxy and get a token services
  • Document setValueRef with value references

Testing required outside of automated testing?

  • Not Applicable

Screenshots (if appropriate):

  • Not Applicable

Rollback / Rollforward Procedure

  • Roll Forward
  • Roll Back

Reviewer Checklist

  • Description of Change
  • Description of outside testing if applicable.
  • Description of Roll Forward / Backward Procedure
  • Documentation updated for Change

@jleon15 jleon15 requested a review from a team as a code owner January 25, 2023 21:34
@vercel
Copy link

vercel bot commented Jan 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
developers-basistheory-com ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 26, 2023 at 5:52PM (UTC)

Comment on lines +76 to +86
### createSession

To retrieve sensitive data on Android, you'll need to create a `session` and use its `sessionKey` for making requests securely.
To accomplish this, simply call the `createSession` function like this:

```kotlin showLineNumbers
val session = bt.createSession()
```

This returns a [CreateSessionResponse](/docs/api/applications/sessions#create-session-response-object)
which contains a `nonce` that needs to be used to [authorize the session](/docs/api/applications/sessions#authorize-session) before using it.
Copy link
Contributor

@dhudec dhudec Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should link to https://developers.basistheory.com/docs/guides/govern/sessions

Maybe at the end, add: "To learn more about how to authorize a session, read our guide Access Data Using Sessions"

This function wraps the [get a token API endpoint](/docs/api/tokens/#get-a-token) to
be able to get a single strongly typed token. It then transforms the token's data to
value references which you can use to [set the value](/docs/sdks/mobile/android/types#methods) of your elements without touching
the plaintext value and getting into compliance scope.
Copy link
Contributor

@dhudec dhudec Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this doesn't sound quite right to me to say "getting into" here - to me "getting into" more equates to "learning about" or "being interested in"

Suggested change
the plaintext value and getting into compliance scope.
the plaintext value and pulling your application into compliance scope.

This function receives a [ProxyRequest](/docs/sdks/mobile/android/services#proxyrequest) and wraps the [proxy API endpoint](/docs/api/proxies/invoke-proxy) to
be able to proxy a request to a third party API. It then transforms the response to
value references which you can then use to [set the value](/docs/sdks/mobile/android/types#methods) of your elements without touching
the plaintext value and getting into compliance scope.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the plaintext value and getting into compliance scope.
the plaintext value and pulling your application into compliance scope.

Comment on lines +125 to +126
| `queryParams` | false | _Map<String, String>?_ | `emptyMap()` | Map of query parameters to include in the request. |
| `headers` | false | _Map<String, String>?_ | `emptyMap()` | Map of headers to include in the request. |
Copy link
Contributor

@dhudec dhudec Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having this thought late here in the docs, but technically, query params and headers can be repeated with the same name, so it might be more correct to make these some sort of array of pairs instead of maps. We may never run into that use case from here though, but if we do that would be a breaking change...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, the java sdk receives a map for headers but for query params it does receive a list of pairs instead

### getToken

This function wraps the [get a token API endpoint](/docs/api/tokens/#get-a-token) to
be able to get a single strongly typed token. It then transforms the token's data to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
be able to get a single strongly typed token. It then transforms the token's data to
retrieve a single strongly typed token. It then transforms the token's data to

### proxy

This function receives a [ProxyRequest](/docs/sdks/mobile/android/services#proxyrequest) and wraps the [proxy API endpoint](/docs/api/proxies/invoke-proxy) to
be able to proxy a request to a third party API. It then transforms the response to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
be able to proxy a request to a third party API. It then transforms the response to
proxy a request to a third party API. It then transforms the response to


<Alert>
When using <code>setValueRef</code> to keep a <code>TextElement</code> in sync with another element, or to set the text of an element, it is strongly recommended that
you make the element acted upon readonly by also setting <code>isEditable=false</code>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
you make the element acted upon readonly by also setting <code>isEditable=false</code>.
you make the element that is being acted upon a "readonly" element. This is possible by setting <code>isEditable=false</code>.

When using <code>setValueRef</code> to keep a <code>TextElement</code> in sync with another element, it is strongly recommended that
you make the dependent element readonly by also setting <code>isEditable=false</code>.
<code>ElementValueReference</code> is a class that stores a reference to a value which can only be accessed by BasisTheoryElements, so that
you can reference data without touching the plaintext value and getting into compliance scope.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
you can reference data without touching the plaintext value and getting into compliance scope.
you can reference data without touching the plaintext value and pulling your application into compliance scope.

amkera
amkera previously approved these changes Jan 26, 2023
@jleon15 jleon15 merged commit 9222cf4 into master Jan 26, 2023
@jleon15 jleon15 deleted the eng-4122 branch January 26, 2023 18:14
bt-platform-eng pushed a commit that referenced this pull request Jan 26, 2023
# [1.21.0](v1.20.2...v1.21.0) (2023-01-26)

### Features

* documenting android proxy and retrieve token services ([#50](#50)) ([9222cf4](9222cf4))
@bt-platform-eng
Copy link

🎉 This PR is included in version 1.21.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants