Example #1
0
## MAGE imports
from ref.models import Project, Environment, LogicalComponent, Application, SLA, \
    ComponentImplementationClass, ConventionCounter, ExtendedParameter, \
    EnvironmentType, ImplementationFieldDescription, ImplementationDescription, \
    ImplementationRelationDescription, ImplementationRelationType, \
    ImplementationComputedFieldDescription, ComponentInstanceField, \
    ComponentInstanceRelation
from ref.models.parameters import MageParam
from ref.models.com import Link

################################################################################
## Create admin site object
################################################################################

site = AdminSite()
site.login_template = 'login.html'
site.site_header = "Administration MAGE"
site.site_title = 'MAGE'
site.index_title = None
site.register(Group, GroupAdmin)
site.register(User, UserAdmin)

################################################################################
## Parameters
################################################################################


class MageParamAdmin(ModelAdmin):
    list_display = [
        'app',
        'key',
Example #2
0
    idp_configs = backend.setting('ENABLED_IDPS')
    idp_name = next((name for name, cfg in idp_configs.items()
                     if cfg.get('entity_id') == issuer), None)
    if idp_name is None:
        raise ValueError(
            f"IDP not found for Issuer '{issuer}' in logout request: " +
            request_str)

    # формируем адрес редиректа
    idp = backend.get_idp(idp_name)
    if idp.slo_config == {}:  # если конфига slo нет
        url = settings.LOGOUT_REDIRECT_URL
    else:
        url = backend._create_saml_auth(
            idp, remove_signature_from_get=True).process_slo()

    return HttpResponseRedirect(url)


# Custom admin login view (with button for authentication via ADFS)
site = AdminSite()
site.login_template = 'admin/login_form.html'


@ensure_csrf_cookie
def admin_login_view(request):
    extra_context = {
        'saml_idps': getattr(settings, 'SOCIAL_AUTH_SAML_ENABLED_IDPS', {})
    }
    return site.login(request, extra_context=extra_context)
Example #3
0
from ref.models import Project, Environment, LogicalComponent, Application, SLA, \
    ComponentImplementationClass, ConventionCounter, ExtendedParameter, \
    EnvironmentType, ImplementationFieldDescription, ImplementationDescription, \
    ImplementationRelationDescription, ImplementationRelationType, \
    ImplementationComputedFieldDescription, ComponentInstanceField, \
    ComponentInstanceRelation
from ref.models.parameters import MageParam
from ref.models.com import Link


################################################################################
## Create admin site object
################################################################################

site = AdminSite()
site.login_template = 'login.html'
site.site_header = "Administration MAGE"
site.site_title = 'MAGE'
site.index_title = None
site.register(Group, GroupAdmin)
site.register(User, UserAdmin)


################################################################################
## Parameters
################################################################################

class MageParamAdmin(ModelAdmin):
    list_display = ['app', 'key', 'value', 'model', 'axis1', 'description', ]
    search_fields = ['app', 'key', 'value', 'axis1', ]
    list_filter = ['app', ]  #'model',]