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

Flatten check-out handlers #54

Conversation

tyrannosaurus-becks
Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks commented Oct 2, 2019

This PR:

  • Replaces the CheckOutHandler interface with a struct by the same name.
  • Flattens the code from the StorageHandler and the PasswordHandler onto that struct.
  • Updates previous tests to test for the same stuff but using the new, flattened struct instead (to make sure it behaves as expected.)
  • Replaces the validateInputs func with inline input validation because it seemed that less indirection was desired; however, happy to add it back if that's preferable.
  • Renames the file containing the code from checkout_handlers.go (plural) to checkout_handler.go (singular), which makes it look like more code change than it is.

This PR is really just a bunch of code being moved around, it doesn't change anything or introduce anything new.

TODO (separate PR)

  • More final testing

plugin/checkout_handler.go Outdated Show resolved Hide resolved
plugin/checkout_handler.go Outdated Show resolved Hide resolved
plugin/checkout_handler.go Outdated Show resolved Hide resolved
Copy link
Contributor

@kalafut kalafut left a comment

Choose a reason for hiding this comment

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

This PR looks good aside from a couple minor items.

@tyrannosaurus-becks tyrannosaurus-becks changed the base branch from add-checkout-endpoints to feature-ad-credential-checkout October 8, 2019 23:30
@tyrannosaurus-becks tyrannosaurus-becks force-pushed the checkout-handlers-and-races branch from b89b4fa to 0185f1e Compare October 8, 2019 23:36
@tyrannosaurus-becks tyrannosaurus-becks merged commit 7ebec06 into feature-ad-credential-checkout Oct 8, 2019
@tyrannosaurus-becks tyrannosaurus-becks deleted the checkout-handlers-and-races branch October 8, 2019 23:38
tyrannosaurus-becks added a commit that referenced this pull request Oct 10, 2019
* change readConfig from a method to a function (#39)

* Add storage handler (#41)

* add storage handler

* changes from feedback

* add validateInputs func and tests

* fix comment indentation

* comment all exported items

* fix comment indentation

* Add password handler (#43)

* add password handler

* add ErrNotFound

* fix build ooms (#46)

* Add reserve API endpoints (#47)

* fix test edits that were for debugging (#48)

* Add checkout status endpoint (#50)

* add checkout status endpoint

* only return the available field if its checked in

* order imports

* Add enforcement toggle (#49)

* add enforcement toggle

* add more tests

* replace lending period with ttl and max ttl (#51)

* Rename reserve to set (#52)

* rename reserve to set

* update test err

* remove dupe ttl lines

* Add check-out, check-in, renewal, revocation, and race protection (#53)

* flatten check-out handler (#54)

* finish replacing Reserve with Set

* Fixes from testing (#56)

* error loudly on unauthorized check-ins

* 400 when check-outs are unavailable

* make check-ins an empty array when none are executed

* dont error if someone tries to check in an account already in

* Update plugin/path_checkouts.go

Co-Authored-By: Jim Kalafut <[email protected]>

* log and count when check-outs are unavailable (#57)
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.

2 participants