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

docs: looker oauth implementation example #995

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

josephaxisa
Copy link
Contributor

No description provided.

Copy link
Contributor

@joeldodge79 joeldodge79 left a comment

Choose a reason for hiding this comment

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

Nice! I don't feel qualified to review the react but I do feel like an examples/looker-oauth/README.md would be good to guide setup

@bryans99
Copy link
Collaborator

Nice! I don't feel qualified to review the react but I do feel like an examples/looker-oauth/README.md would be good to guide setup

+1 to this!!!

@josephaxisa
Copy link
Contributor Author

for sure, it's on my todo list for this PR.

Copy link
Collaborator

@bryans99 bryans99 left a comment

Choose a reason for hiding this comment

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

Testing issue.

  1. Left form field empty and hit enter. Login enabled.
  2. Clicked login and it hung on the configuration page. Totally stuck at this point. I suspect I have to delete something from local storage

Suggest:

  1. change UI to form field and single button. Button protected if form field is not a valid URL.
  2. Ping versions endpoint to validate URL?

More testing

Deleted local storage and entered valid URL. Routed me to server and I logged in successfully. Back to /oauth and hangs

"scripts": {
"develop": "webpack serve --host=0.0.0.0 --https --disable-host-check --config webpack.dev.config.js"
},
"dependencies": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

My concern about the examples is the difficulty we have keeping the versions up to date. We have an issue with the access token server which I'm thinking should be moved to packages and eventually deleted when artifacts is done.

I don't know of a better place to put the example. I've been thinking of writing a script for examples that allows me to update versions easily. May be the script should go here and it can be run after each publish and eventually automated? Perhaps a script to ensure that examples have been updated to the current version when we do a publish. Maybe we can have a CI job update the packages post publish.

Thinking out loud here. Totally unrelated to the merits of this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you've created this script now, @bryans99?


export const ConfigKey = 'serverConfig'

export const initSdk = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could go into extension-utils (which should be renamed). It can accept configKey, baseUrl, agentTag and maybe track performance as arguments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, see #1000

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also agree that we should rename extension-utils. We should discuss with @jkaster

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I don't know how I missed this before. Maybe I was on vacation? Anyway, what are suggested other names?

examples/looker-oauth/src/utils.ts Show resolved Hide resolved
examples/looker-oauth/src/index.tsx Show resolved Hide resolved
examples/looker-oauth/src/HomeScene.tsx Show resolved Hide resolved
examples/looker-oauth/src/ConfigForm.tsx Show resolved Hide resolved
<Route path="/oauth">
<OAuthScene adaptor={adaptor} />
</Route>
<Route path="/" exact>
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if path not '/' and not '/oauth'? Can we remove the path and exact?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is something I did not think of. I will eliminate the "/" path so that it can handle anything.

@josephaxisa
Copy link
Contributor Author

josephaxisa commented Feb 21, 2022

This PR is still very much a draft. I will polish it a bit more tomorrow, please hold off on re-reviewing.

TODOs:

  • readme
  • use versions url to get api server url
  • provide way to clear local storage
  • better error handling

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

Successfully merging this pull request may close these issues.

4 participants