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

Two fixes related to the Instserver M2M changes (reinstate #7) #12

Closed

Conversation

vladimir-mencl-eresearch
Copy link
Collaborator

Hi Zenon,

These are the fixes I originally pushed in #7 - now in a separate branch.

Cheers,
Vlad

if not 'ertype' in self.cleaned_data:
raise forms.ValidationError(_('The Type field is required to validate this field.'))
ertype = self.cleaned_data['ertype']
if ertype in [1,3]:
Copy link
Contributor

Choose a reason for hiding this comment

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

This field is actually required even if the institution/server is SP only, because NRO servers may need to know whether they should handle accounting packets. We want to deprecate accounting and thus get rid of RADTYPES in the future, but this is how things stand for now. So I believe you should remove any 'ertype' checking in this function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, scratch this comment, it is not true: there is no use of rad_pkt_type for SP only servers/institutions. Your approach is fine and it is more appropriate than checking institution ertype. Eventually we should also remove/hide this field from the form for such cases.

@zmousm
Copy link
Contributor

zmousm commented Feb 18, 2016

Hi Vladimir. Thanks for this. Apart from the line note, LGTM!

Please rebase on branch next:

  • next is rewritten master branch with the instserver_m2m commit
  • master is the rewritten branch without the instserver_m2m commit

@zmousm
Copy link
Contributor

zmousm commented Feb 20, 2016

Rebase on next and it's ready to merge.

Update code linking from Institution to InstServer to reflect changes in the
model introduced in 15691d3 - instead of instserver_set, use the relation name
"servers" now explicitly given in the model.
The validation code was relying on each server having just one institution.

With the M2M mapping of Institutions and Servers, change the logic in
clean_ertype to iterate over all institutions and check the server ertype
complies with all of the institutions / their ertype values.

For other server values required for an IdP (auth_port, acct_port, pkt_type),
check them against this server er_type.

When fetching the ertype of this server, check it has been set to avoid an
embarassing KeyError.
@vladimir-mencl-eresearch
Copy link
Collaborator Author

Re-submitted as #13 with next as the target for merging.

zmousm added a commit that referenced this pull request Feb 22, 2016
 Two fixes related to the Instserver M2M changes (reinstate #7/#12)
@vladimir-mencl-eresearch vladimir-mencl-eresearch deleted the fix-instserver-M2M branch February 22, 2016 20:59
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