Skip to content

Commit

Permalink
fix(url slash): 统一URL后缀slash
Browse files Browse the repository at this point in the history
  • Loading branch information
Oo-RR-oO committed Jul 20, 2020
1 parent d7368e4 commit e1bb526
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions djangosaml2idp/idpsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
'xmlsec_binary':
get_xmlsec_binary(['/opt/local/bin', '/usr/bin/xmlsec1']),
'entityid':
'%s/saml/metadata' % settings.BASE_URL,
'%s/saml/metadata/' % settings.BASE_URL,
'description':
'longguikeji IdP setup',
'service': {
'idp': {
'name': 'Django localhost IdP',
'endpoints': {
'single_sign_on_service': [
('%s/saml/sso/post' % settings.BASE_URL, BINDING_HTTP_POST),
('%s/saml/sso/redirect' % settings.BASE_URL, BINDING_HTTP_REDIRECT),
('%s/saml/sso/post/' % settings.BASE_URL, BINDING_HTTP_POST),
('%s/saml/sso/redirect/' % settings.BASE_URL, BINDING_HTTP_REDIRECT),
],
},
'name_id_format': [NAMEID_FORMAT_EMAILADDRESS, NAMEID_FORMAT_UNSPECIFIED],
Expand Down
6 changes: 3 additions & 3 deletions djangosaml2idp/idpview.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,16 @@ def dispatch(self, request, *args, **kwargs):
SAML_IDP_CONFIG = { # pylint: disable=invalid-name
'debug': settings.DEBUG,
'xmlsec_binary': get_xmlsec_binary(['/opt/local/bin', '/usr/bin/xmlsec1']),
'entityid': '%s/saml/metadata' % settings.BASE_URL,
'entityid': '%s/saml/metadata/' % settings.BASE_URL,
'description': 'longguikeji IdP setup',

'service': {
'idp': {
'name': 'Django localhost IdP',
'endpoints': {
'single_sign_on_service': [
('%s/saml/sso/post' % settings.BASE_URL, BINDING_HTTP_POST),
('%s/saml/sso/redirect' % settings.BASE_URL, BINDING_HTTP_REDIRECT),
('%s/saml/sso/post/' % settings.BASE_URL, BINDING_HTTP_POST),
('%s/saml/sso/redirect/' % settings.BASE_URL, BINDING_HTTP_REDIRECT),
],
},
'name_id_format': [NAMEID_FORMAT_EMAILADDRESS, NAMEID_FORMAT_UNSPECIFIED],
Expand Down
8 changes: 5 additions & 3 deletions oneid_meta/models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ class APP(BaseModel):
def __str__(self):
return f'APP: {self.uid}({self.name})'

def save(self, *args, **kwargs): # pylint: disable=arguments-differ
# pylint: disable=arguments-differ
# pylint: disable=signature-differs
def save(self, *args, **kwargs):
if APP.valid_objects.filter(uid=self.uid).exclude(pk=self.pk).exists():
msg = "UNIQUE constraint failed: " \
"oneid_meta.APP UniqueConstraint(fields=['uid'], condition=Q(is_del='False')"
Expand Down Expand Up @@ -322,11 +324,11 @@ def more_detail(self):
{
'name': 'IdP方元数据接口',
'key': 'entity_id',
'value': settings.BASE_URL + '/saml/metadata',
'value': settings.BASE_URL + '/saml/metadata/',
},
{
'name': 'IdP单点登录SSO接口',
'key': 'sso',
'value': settings.BASE_URL + '/saml/sso/redirect' + ';' + settings.BASE_URL + '/saml/sso/post'
'value': settings.BASE_URL + '/saml/sso/redirect/' + ';' + settings.BASE_URL + '/saml/sso/post/'
},
]

0 comments on commit e1bb526

Please sign in to comment.