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

Auth jetstream refactor #3882

Merged
merged 25 commits into from
Nov 1, 2019
Merged

Auth jetstream refactor #3882

merged 25 commits into from
Nov 1, 2019

Conversation

kreinecke
Copy link
Contributor

Refactor UAA and Local login auth code.

  • StratosAuth interface created that provides generic login/logout/verifysession methods.
  • Separate structs for local and UAA auth implement that interface. External references are to the interface only. Concrete type is instantiated at startup based on the configured remote/local endpoint type.
  • Global portalProxy struct remains for now but the aim to break this up as more refactoring is done - plugins will then use a collection of interfaces.
  • Auth code remains at top level until codebase sufficiently decoupled to allow moving down into packages. Interfaces will then be public and structs hidden.
  • Some utility functions and portalProxy methods with low dependencies moved down into packages where possible.
  • Echo routing now has auth routes grouped.

Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
…nd login auth groups

Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
@cfdreddbot
Copy link

✅ Hey kreinecke! The commit authors and yourself have already signed the CLA.

@codecov
Copy link

codecov bot commented Sep 18, 2019

Codecov Report

Merging #3882 into v2-master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           v2-master    #3882   +/-   ##
==========================================
  Coverage      52.21%   52.21%           
==========================================
  Files            785      785           
  Lines          23017    23017           
  Branches        4124     4124           
==========================================
  Hits           12019    12019           
  Misses         10998    10998

Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
@kreinecke kreinecke added jetstream Backend related issues ready for review labels Sep 18, 2019
@kreinecke kreinecke self-assigned this Sep 18, 2019
@kreinecke kreinecke requested a review from nwmac September 19, 2019 08:00
kreinecke and others added 4 commits September 20, 2019 14:07
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
Signed-off-by: Kate E. Reinecke <50168367+kreinecke@users.noreply.github.com>
@KlapTrap
Copy link
Contributor

@nwmac Did you review this?

Copy link
Contributor

@nwmac nwmac left a comment

Choose a reason for hiding this comment

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

A couple of comments

@@ -126,6 +126,10 @@ func (ch *CFHosting) Init() error {

//Force auth endpoint type to remote (CF UAA)
ch.portalProxy.GetConfig().ConsoleConfig.AuthEndpointType = "remote"
err := ch.portalProxy.InitStratosAuthService(interfaces.Remote)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to do the init here? Its done in main.go.

We override the type to remote - so won't the init in main.go do the right thing?

If so, we can remove InitStratosAuthService from the interface we expose to plugins

GetEndpointTypeSpec(typeName string) (EndpointPlugin, error)

// Auth
InitStratosAuthService(t AuthEndpointType) error
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good not to expose this to plugins.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 16, 2019

CLA Check
The committers are authorized under a signed CLA.

@nwmac nwmac changed the base branch from v2-master to master October 29, 2019 15:06
@codecov-io
Copy link

codecov-io commented Oct 30, 2019

Codecov Report

Merging #3882 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #3882   +/-   ##
=======================================
  Coverage   61.12%   61.12%           
=======================================
  Files         860      860           
  Lines       29359    29359           
  Branches     4294     4294           
=======================================
  Hits        17945    17945           
  Misses      11414    11414

@nwmac nwmac merged commit ffc629e into master Nov 1, 2019
@nwmac nwmac deleted the auth-jetstream-refactor branch November 1, 2019 20:11
KlapTrap added a commit that referenced this pull request Nov 11, 2019
* master:
  Add clean routes to e2e-clean-remnants (#4007)
  Auth jetstream refactor (#3882)
  Remove page nav not needed
  Local user account docs (#3952)
  Fix go mod files (#3986)
  Update references following graduation
  Ensure build cache upload fail does not fail job (#3994)
  Fixes issue properly
  Preparation for 2.6.0 Release
  Fix alignment of user button on newer Firefox
  Fix cert gen on Mac OSX 10.15
KlapTrap added a commit that referenced this pull request Nov 13, 2019
* master: (38 commits)
  CC fixes
  When viewing enpoint events, provide an endpoint only events view.
  Change error time period to 30 minutes
  Fixed exception
  Minor endpoint page changes
  Update events page slightly
  Fix app summay page warning for autoscaler check
  Fix unit tests
  Tidy up
  Finish wiring in of notification bar to errors, fix issue with multiple triggered events for same config
  Only show bell when there's notifications (whether read or unread)
  Allow notifications to be marked as 'read' - read notifications will not be shown in the alarm bell count
  WIP
  Add clean routes to e2e-clean-remnants (#4007)
  Tie in error state to notifications
  Allow notifications to be marked as 'read' - read notifications will not be shown in the alarm bell count
  Fix unit tests
  Fix exception on endpoint errors
  Linting
  Auth jetstream refactor (#3882)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jetstream Backend related issues ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants