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

v3 fixClientId #478

Closed
wants to merge 118 commits into from
Closed

v3 fixClientId #478

wants to merge 118 commits into from

Conversation

cleve-fauna
Copy link
Contributor

@cleve-fauna cleve-fauna commented Dec 5, 2024

Ticket(s): FE-###

Problem

Explain the context and why you're making that change. What is the problem you're trying to solve? In some cases there is not a problem and this can be thought of being the motivation for your change.

Solution

Describe the modifications you've done.

Result

What will change as a result of your pull request? Note that sometimes this section is unnecessary because it is self-explanatory based on the solution.

Testing

Describe the manual and automated tests you completed to verify the change is working as expected.

echo-bravo-yahoo and others added 30 commits October 3, 2024 17:21
* poc for new login auth

* remove unused code from poc

* no need client secret for auth code

* some fixups

* better port selection

* avoid race condition

* Update src/commands/login.ts

Co-authored-by: Cleve Stuart <[email protected]>

* Update src/commands/login.ts

Co-authored-by: Cleve Stuart <[email protected]>

* surface error_description and leverage open() to for oauth prompt

* move login command to yargs

---------

Co-authored-by: Cleve Stuart <[email protected]>
Co-authored-by: Ashton Eby <[email protected]>
* add schema push command

* add schema pull, status commands

* address pr feedback
* improve schema commands, add fetch wrapper, add verbosity controls

* breakout frontdoor client and get login working

* improve error handling, logging, standardize help text capitalization

* wip

* wip

* wip

* finish error handling tests, behavior

* more fixes

* basic login test with mocked oauth and account

---------

Co-authored-by: Ashton Eby <[email protected]>
this commit:
  - adds several tests for schema commands
  - adds mocha root hooks to clean up sinon
  - adds sinon-chai for better assertion syntax
  - swaps @cloudcmd/stub for sinon in most places
  - rewrites schema pull helpers to parallelize work
also fixes a few bugs in those commands and stubs out the functionality
to test for other commands.
* extend makeFaunaRequest to include request body

* rewrite schema push to use makeFaunaRequest

* fix URL constructors and error handlers

* remove @cloudcmd/stub in favor of sinon

* add test watch mode and junit reporter

* Updated config.yml
* watch mode doesn't work; change script back to one-shot

* normalize paths and resolve ~ in paths

* clean up types, enable @ts-check in more places

* fix schema push and pull commands

also adds a few types and another test
* delete unused files

* remove unused dependencies and package.json scripts

* upgrade eslint, remove babel

* update awilix and open

* upgrade prettier

* upgrade types

* upgrade inquirer

* upgrade husky

* clean up entrypoint
mwilde345 and others added 28 commits November 27, 2024 13:45
* refresh credentials during fetch calls

* don't create dupe keys

* Update src/config/setup-test-container.mjs

Co-authored-by: echo-bravo-yahoo <[email protected]>

* logger component

* refactor credentials

* refactor credentials

* separate concerns of account and database creds into separate classes

* revert create database changes

* get rid of authnz middleware

* further separate concerns

* fix directory for creds. add some env var options

* fix lint

* skip busted test

* unsafe accessor fix

* try test fix

* fix tests

* don't set a default role in the args. resolve it in credentials. mock homedir

* readme and remove .fauna dir

* don't use exit just throw an error

---------

Co-authored-by: echo-bravo-yahoo <[email protected]>
* Rename query to fql
* Hook up creds for database paths
* Remove old fauna client helpers
* Move common validator to command helpers
* Update examples to use -d and -r for now
* Support running commands against container.

* Complete rebase

* Keep test deleted

* Remove duplicate options

* Fix test to look for correct args

* Add tests

* Remove dead code

* Remove more dead code
…et is not. Always respect argv.secret when getting a secret with FaunaClient.getSecret. (#449)

* FE-5990 Set argv.secret to 'secret' when --local passed in and --secret is not. Always respect argv.secret when getting a secret with FaunaClient.getSecret.

* fix javadoc type

* Update src/lib/fauna-client.mjs

* Update src/lib/fauna-client.mjs

* Use middlware

* Use middleware not check

* Move middlware to the cli.mjs

* Don't look for local. Rely on the middlware to set secret

---------

Co-authored-by: Paul Paterson <[email protected]>
… when --local applies changes to argv. (#450)

* Move middleware to separate method for testability. Add debug logging when --local applies changes to argv.

* Use constants for default settings

* Put applyLocalArg in array of middleware run post-validatoin
* spruce up the list database command

* fix for linter

* return from listDatabases

* appease linter for real

* add tests

* appease linter again

* fix bug

* add more tests

* appease linter
…l used. (#452)

* Confirm correct usage of Fauna instead of the Account API when --local used.

* Run all the tests
* Support colorizing output in database, query, and shell commands

* Add a tty check for colorized output in the format helper functions
* add methods to command signature for database, schema

from the top level command (`fauna`), the help text shows the key
command as:
```
fauna key <method>
```

while it shows database and schema as:
```
fauna database
fauna schema
```

this commit standardizes the signature (and thus help text) to the
style used by keys - `fauna <command> <method>`.

* make command definitions consistent

minor refactor of how we declare commands for consistency. no
customer-facing changes.
* Implement shell history
* support --database in all database commands

* support --database in database create

* support --database in database delete

* test new validation

* unclobber logging change

* fix test

* don't duplicate refresh logic

* put common validation in one place

* fix tests

* appease linter
there are a bunch of places where we want to rely on argv _before_ yargs
is formally done parsing them. in those situations we rely on a
patchwork of different strategies, with different failings.

this commit moves towards a new strategy - using yargs-parser 'raw' (not
through yargs). this is primarily to prevent yargs' parsing side effects
(running command handlers, overwriting help text, etc).

from a customer-facing perspective, this change allows us to emit
verbose debugging logs earlier - without it, verbose debugging doesn't
work in steps like config parsing.
previously, we'd disabled the --version flag on all commands to not
conflict with the --version flag that switched between FQL v4 and FQL
v10 behavior. now that the flag that does that switching is named
--api-version, we can implement the more standard --version behavior by
showing the CLI application version.
* Add improved error handling for known and unknown errors

---------

Co-authored-by: echo-bravo-yahoo <[email protected]>
right now, we present all the options in one blob. this change groups
the config options into these groups:
- Output (format, quiet, color)
- Config (config, profile)
- API (user, role, database, secret)
- Debug (verbosity, verboseComponent)
- Options (help and all command-specific options)

these groups can/should be renamed and rearranged, but this grouping
should be a readability improvement over the current soup of flags.
* support short hand region groups like us & eu
* disable strict options parsing

env variables for query settings (FAUNA_SECRET, etc) are too useful to not
have set, but they fail strict options parsing for commands that don't
use them. this commit turns off strict options parsing for now while we find a
better way to address this.

* Catch unknown commands

---------

Co-authored-by: E. Cooper <[email protected]>
* Add dynamic key support to schema

* Fix missing container resolution

---------

Co-authored-by: echo-bravo-yahoo <[email protected]>
* Remove some options from login command

* help text suggestions

Co-authored-by: James Rodewig <[email protected]>

---------

Co-authored-by: E. Cooper <[email protected]>
Co-authored-by: James Rodewig <[email protected]>
right now, 6 tests in the general CLI test suite rely on terminal color
escape sequences. these are a pain to get consistent across environments
and multiple developers' terminals - so for now, let's remove the
escapes sequences from the text we assert and run the commands without
color.

Co-authored-by: E. Cooper <[email protected]>
* lint and prettify on PR push/change

this change updates the linting github action to commit the changes that
prettier causes. this will keep the codebase consistently prettified
without requiring client-side git hooks. it could also commit linting
changes (by running `npm run lint --fix`), but this PR does not enable
that out of an abundance of caution for the changes the linter might
introduce.

* add husky commit hook for linting

* fail CI tests if they encounter `.only`

* run prettier, eslint on whole project
* Don't parse for help or version when doing config

* Use yargsParser in configuration middleware

* use yargs-parser; fix tests

---------

Co-authored-by: Ashton Eby <[email protected]>
@cleve-fauna cleve-fauna closed this Dec 5, 2024
@cleve-fauna cleve-fauna deleted the v3_fixClientId branch December 5, 2024 14:47
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.

7 participants