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

[DXCDT-19] Use GET instead of POST when downloading quickstarts #391

Merged
merged 2 commits into from
Jan 28, 2022

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Jan 27, 2022

By submitting a PR to this repository, you agree to the terms within the Auth0 Code of Conduct. Please see the contributing guidelines for how to create and submit a high-quality PR for this repo.

Description

In this PR we are changing how we download the quickstarts sample by making a GET request instead of a POST and intentionally removing from the payload the following: client_secret, tenant, and domain.

We also update the data/quickstarts.json file with the latest sample structure and naming using the quickstarts-json-generator branch.

Unfortunately with the GET endpoint there doesn't seem to be any way for us to have the .env files replaced with the correct values as well.

Sample output:

 ~/auth0/auth0-cli  patch/fix-download *3 !1  go run cmd/auth0/main.go quickstarts download                                                           ✔  18:16:08
 Client ID: SomeID
 Stack: Go
 WARNING: /Default-App already exists.
 Are you sure you want to proceed? Yes
 ▸    Quickstart sample sucessfully downloaded at /Default-App

   Auth0 + Go Web App Sample

  This sample demonstrates how to add authentication to a Go web app using
  Auth0.

  Check the Go Quickstart https://auth0.com/docs/quickstart/webapp/golang to
  better understand this sample.

  ## Running the App

  To run the app, make sure you have go installed.

  Rename the  .env.example  file to  .env  and provide your Auth0 credentials.

    # .env

    AUTH0_CLIENT_ID=YOUR_CLIENT_ID
    AUTH0_DOMAIN=YOUR_DOMAIN
    AUTH0_CLIENT_SECRET=YOUR_CLIENT_SECRET
    AUTH0_CALLBACK_URL=http://localhost:3000/callback

  Once you've set your Auth0 credentials in the  .env  file, run  go mod
  vendor  to download the Go dependencies.

  Run  go run main.go  to start the app and navigate to
  http://localhost:3000/.

  ## What is Auth0?

  Auth0 helps you to:

  • Add authentication with multiple authentication sources
  https://docs.auth0.com/identityproviders, either social like Google,
  Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce,
  amont others, or enterprise identity systems like Windows Azure AD, Google
  Apps, Active Directory, ADFS or any SAML Identity Provider.
  • Add authentication through more traditional username/password databases.
  • Add support for linking different user accounts with the same user.
  • Support for generating signed Json Web Tokens https://docs.auth0.com/jwt
  to call your APIs and flow the user identity securely.
  • Analytics of how, when and where users are logging in.
  • Pull data from other sources and add it to the user profile, through
  JavaScript rules https://docs.auth0.com/rules.

  ## Create a free Auth0 account

  1. Go to Auth0 https://auth0.com/signup and click Sign Up.
  2. Use Google, GitHub or Microsoft Account to login.

  ## Issue Reporting

  If you have found a bug or if you have a feature request, please report them
  at this repository issues section. Please do not report security
  vulnerabilities on the public GitHub issue tracker. The Responsible
  Disclosure Program https://auth0.com/whitehat details the procedure for
  disclosing security issues.

  ## Author

  Auth0 https://auth0.com

  ## License

  This project is licensed under the MIT license. See the LICENSE /LICENSE.txt
  file for more info.

 ▸    Hint: Start with 'cd Default-App/01-Login'

References

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@sergiught sergiught marked this pull request as ready for review January 28, 2022 09:23
@sergiught sergiught requested a review from Widcket January 28, 2022 09:23
@@ -41,7 +41,7 @@
"branch": "master"
},
{
"name": "Go",
"name": "Go API",
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to see this file updated 👏🏼

Copy link
Contributor

@Widcket Widcket left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@willvedd willvedd left a comment

Choose a reason for hiding this comment

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

Are there any tests that should be changed along with this fix?

@sergiught
Copy link
Contributor Author

Note: We agreed to look at the testing strategy for this command in a follow up PR.

@sergiught sergiught merged commit fd0ce1d into main Jan 28, 2022
@sergiught sergiught deleted the patch/fix-download branch January 28, 2022 16:58
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.

3 participants