Skip to content

Remove lib/auth/webauthn dependency from webauthncli#30377

Merged
codingllama merged 15 commits intomasterfrom
codingllama/independent-wancli
Aug 14, 2023
Merged

Remove lib/auth/webauthn dependency from webauthncli#30377
codingllama merged 15 commits intomasterfrom
codingllama/independent-wancli

Conversation

@codingllama
Copy link
Copy Markdown
Contributor

Cleanly separate server-side and client-side WebAuthn packages by moving shared type definitions to a new package, called webauthntypes.

The following changes are made:

  • Shared types and conversions are moved to lib/auth/webauthntypes, aliased wantypes
  • Protos from api/types/webauthn, previously aliased wantypes, are now aliased wanpb
  • webauthnwin is aliased to wanwin, for brevity and consistency
  • A couple of references are kept until we can change e/

No functional changes. Refactors are either IDE-driven or the result of simple seds.

@github-actions github-actions Bot added desktop-access size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport. labels Aug 11, 2023
@codingllama
Copy link
Copy Markdown
Contributor Author

Easier to understand commit-by-commit. It's a bit uninteresting to review, but should be fairly mechanical - it's mostly moves and renames, no real changes.

I'll take a look at the linter and failed tests (I think I trimmed some spaces that were actually important?)

@codingllama
Copy link
Copy Markdown
Contributor Author

Package deps:

# lib/auth/touchid
$ go list -f '{{range $i, $pkg := .Deps}}{{printf "%s\n" $pkg}}{{end}}' ./lib/auth/touchid | grep gravitational
github.com/gravitational/teleport/api/types/webauthn
github.com/gravitational/teleport/lib/auth/webauthntypes
github.com/gravitational/teleport/lib/darwin
github.com/gravitational/trace
github.com/gravitational/trace/internal

# lib/auth/webauthnwin
$ go list -f '{{range $i, $pkg := .Deps}}{{printf "%s\n" $pkg}}{{end}}' ./lib/auth/webauthnwin | grep gravitational
github.com/gravitational/teleport/api
github.com/gravitational/teleport/api/client/proto
github.com/gravitational/teleport/api/constants
github.com/gravitational/teleport/api/defaults
github.com/gravitational/teleport/api/gen/proto/go/attestation/v1
github.com/gravitational/teleport/api/gen/proto/go/teleport/accesslist/v1
github.com/gravitational/teleport/api/gen/proto/go/teleport/auditlog/v1
github.com/gravitational/teleport/api/gen/proto/go/teleport/devicetrust/v1
github.com/gravitational/teleport/api/gen/proto/go/teleport/header/v1
github.com/gravitational/teleport/api/gen/proto/go/teleport/trait/v1
github.com/gravitational/teleport/api/gen/proto/go/teleport/userloginstate/v1
github.com/gravitational/teleport/api/gen/proto/go/usageevents/v1
github.com/gravitational/teleport/api/types
github.com/gravitational/teleport/api/types/common
github.com/gravitational/teleport/api/types/events
github.com/gravitational/teleport/api/types/webauthn
github.com/gravitational/teleport/api/types/wrappers
github.com/gravitational/teleport/api/utils
github.com/gravitational/teleport/api/utils/atlas
github.com/gravitational/teleport/api/utils/aws
github.com/gravitational/teleport/api/utils/azure
github.com/gravitational/teleport/api/utils/keys
github.com/gravitational/teleport/api/utils/sshutils/ppk
github.com/gravitational/teleport/api/utils/tlsutils
github.com/gravitational/teleport/lib/auth/webauthntypes
github.com/gravitational/trace
github.com/gravitational/trace/internal

If you go list it, lib/auth/webauthncli still pulls lib/auth/webauthn, but it's only in test files.

@codingllama codingllama force-pushed the codingllama/independent-wancli branch from fd92980 to 571861e Compare August 14, 2023 20:00
@zmb3
Copy link
Copy Markdown
Collaborator

zmb3 commented Aug 14, 2023

/excludeflake *

@codingllama codingllama enabled auto-merge August 14, 2023 20:21
@codingllama codingllama added this pull request to the merge queue Aug 14, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 14, 2023
@codingllama codingllama added this pull request to the merge queue Aug 14, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to Branch Protection failures Aug 14, 2023
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@codingllama codingllama added this pull request to the merge queue Aug 14, 2023
Merged via the queue into master with commit b30d9c2 Aug 14, 2023
@codingllama codingllama deleted the codingllama/independent-wancli branch August 14, 2023 21:49
@public-teleport-github-review-bot
Copy link
Copy Markdown

@codingllama See the table below for backport results.

Branch Result
branch/v11 Failed
branch/v12 Failed
branch/v13 Failed

codingllama added a commit that referenced this pull request Aug 15, 2023
* Alias `api/types/webauthn` imports to `wanpb`

* Use `webauthnpb` as the default package name

* Move messages.go to webauthntypes/

* Move extensions.go to webauthntypes/

* Move proto.go to webauthntypes/

* nit: Use consistent license style

* Use the `wantypes` alias for webauthntypes

* Use the `wanwin` alias for webauthnwin

* nit: Move winwebauthn.go to webauthnwin.go

* Document package webauthntypes

* Alias types required by e/

* Appease linter

* Add all main types/method to compat.go

* Reinstate spaces on proxy_test.go

* Alias newly-added usages
codingllama added a commit that referenced this pull request Aug 15, 2023
* Alias `api/types/webauthn` imports to `wanpb`

* Use `webauthnpb` as the default package name

* Move messages.go to webauthntypes/

* Move extensions.go to webauthntypes/

* Move proto.go to webauthntypes/

* nit: Use consistent license style

* Use the `wantypes` alias for webauthntypes

* Use the `wanwin` alias for webauthnwin

* nit: Move winwebauthn.go to webauthnwin.go

* Document package webauthntypes

* Alias types required by e/

* Appease linter

* Add all main types/method to compat.go

* Reinstate spaces on proxy_test.go

* Alias newly-added usages
github-merge-queue Bot pushed a commit that referenced this pull request Aug 15, 2023
* Represent `protocol` within `wanlib` and update go-webauthn (#29750)

* Represent the entirety of protocol within lib/auth/webauthn

* Bump github.com/go-webauthn/webauthn to v0.6.2

* Fixes for v0.6.x: Challenge, RPOrigins

* Bump github.com/go-webauthn/webauthn to v0.7.2

* Document new v0.7.2 fields

* Bump github.com/go-webauthn/webauthn to v0.8.2

* Fixes for v0.8.x: UserEntity.ID

* Bump github.com/go-webauthn/webauthn to v0.8.6

* Let bots update go-webauthn

* Drop support for RP and User icon

* Update generated protos

* Add a brief godoc to cloned types

* Undo go-webauthn compatibility changes

* Remove `lib/auth/webauthn` dependency from `webauthncli` (#30377)

* Alias `api/types/webauthn` imports to `wanpb`

* Use `webauthnpb` as the default package name

* Move messages.go to webauthntypes/

* Move extensions.go to webauthntypes/

* Move proto.go to webauthntypes/

* nit: Use consistent license style

* Use the `wantypes` alias for webauthntypes

* Use the `wanwin` alias for webauthnwin

* nit: Move winwebauthn.go to webauthnwin.go

* Document package webauthntypes

* Alias types required by e/

* Appease linter

* Add all main types/method to compat.go

* Reinstate spaces on proxy_test.go

* Alias newly-added usages

* chore: Drop the lib/auth/webauthn/httpserver test package (#30314)
github-merge-queue Bot pushed a commit that referenced this pull request Aug 15, 2023
* Represent `protocol` within `wanlib` and update go-webauthn (#29750)

* Represent the entirety of protocol within lib/auth/webauthn

* Bump github.com/go-webauthn/webauthn to v0.6.2

* Fixes for v0.6.x: Challenge, RPOrigins

* Bump github.com/go-webauthn/webauthn to v0.7.2

* Document new v0.7.2 fields

* Bump github.com/go-webauthn/webauthn to v0.8.2

* Fixes for v0.8.x: UserEntity.ID

* Bump github.com/go-webauthn/webauthn to v0.8.6

* Let bots update go-webauthn

* Drop support for RP and User icon

* Update generated protos

* Add a brief godoc to cloned types

* Undo go-webauthn compatibility changes

* Remove `lib/auth/webauthn` dependency from `webauthncli` (#30377)

* Alias `api/types/webauthn` imports to `wanpb`

* Use `webauthnpb` as the default package name

* Move messages.go to webauthntypes/

* Move extensions.go to webauthntypes/

* Move proto.go to webauthntypes/

* nit: Use consistent license style

* Use the `wantypes` alias for webauthntypes

* Use the `wanwin` alias for webauthnwin

* nit: Move winwebauthn.go to webauthnwin.go

* Document package webauthntypes

* Alias types required by e/

* Appease linter

* Add all main types/method to compat.go

* Reinstate spaces on proxy_test.go

* Alias newly-added usages

* chore: Drop the lib/auth/webauthn/httpserver test package (#30314)

* Change httpfallback.go imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop-access size/sm tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants