tributemedia / tcb_auth_server

Drupal module to authenticate users on external Drupal sites.
GNU General Public License v3.0
0 stars 0 forks source link

Allow Pantheon domain to be "global" #17

Open tributemedia opened 4 years ago

tributemedia commented 4 years ago

It would be nice if we could enter the base Pantheon domain and have it cover all environments. For example, we have dev-to-engineers-com.pantheonsite.io and updates-to-engineers-com.pantheonsite.io. It would be great if we could just add to-engineers-com.pantheonsite.io to the list of sites and be able to log into all environments, rather than having to add each environment as a site.

AntonioXIII commented 4 years ago

I understand the need for convenience here, especially when you're dealing with a Pantheon site that has a ton of environments. I want to design this in such a way where the functionality you're describing could be applied to any URL, not just those containing 'pantheonsite'.

What I am thinking is doing a form alter on the taxonomy term edit/create form for the TCB Site vocabulary. The form alter would do two things:

  1. Add a checkbox field to the term to make the site a 'partial' rule. This would make it so that any site name queried that contains the 'partial' site name would have the rules for that site applied to it--provided there isn't a more specific TCB Site term. For example, if you had a TCB Site term for to-engineers-com.pantheonsite.io, then any site containing that string within its name would have the rules for that site applied to it. The only exception would be if you had an overriding, more specific term. For example, you could have another TCB Site term for updates-to-engineers-com.pantheonsite.io that would override the base rules defined in the partial term described earlier.
  2. The form alter (on submission) would add the site name to a new DB stored value called 'site partials'. Anytime a site name is queried for, the site name would be evaluated against the list of partials to make sure that the site isn't apart of a partial. If it is, then it would return the configuration of the partial, provided there is no override term declaration (as described in point 1).

Provided what I described will satisfy what you're looking for, what sort of priority would you put this at? From your e-mail it sounds like you weren't in too big of a hurry about this. If that's the case, I would have this in a release for the end of November that I am planning.