#!/usr/bin/env python
# Copyright 2014-2018 CERN for the benefit of the ATLAS collaboration.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Authors:
# - Thomas Beermann <thomas.beermann@cern.ch>, 2014-2017
# - Vincent Garonne <vgaronne@gmail.com>, 2014
# - Mario Lassnig <mario.lassnig@cern.ch>, 2014-2018
# - Martin Barisits <martin.barisits@cern.ch>, 2014-2015
# - Ralph Vigne <ralph.vigne@cern.ch>, 2015
# - Cedric Serfon <cedric.serfon@cern.ch>, 2015-2019
# - Stefan Prenner <stefan.prenner@cern.ch>, 2018
# - Hannes Hansen <hannes.jakob.hansen@cern.ch>, 2019
# - Ruturaj Gujar <ruturaj.gujar23@gmail.com>, 2019
#
# PY3K COMPATIBLE
from io import BytesIO
from json import dumps
from os.path import dirname, join
from tarfile import open, TarError
from gzip import GzipFile
from requests import get, ConnectionError
from web import application, header, input as param_input, seeother, template
from web import cookies
from rucio.api.authentication import get_auth_token_x509
from rucio.common.config import config_get
from rucio.common.utils import generate_http_error
from rucio.web.ui.common.utils import get_token, authenticate, userpass_auth, x509token_auth, saml_auth, oidc_auth, finalize_auth, AUTH_ISSUERS, SAML_SUPPORT
COMMON_URLS = (
'/account_rse_usage', 'AccountRSEUsage',
'/account', 'Account',
'/auth', 'Auth',
'/bad_replicas', 'BadReplicas',
'/suspicious_replicas', 'SuspiciousReplicas',
'/bad_replicas/summary', 'BadReplicasSummary',
'/did', 'DID',
'/heartbeats', 'Heartbeats',
'/lifetime_exception', 'LifetimeException',
'/list_lifetime_exceptions', 'ListLifetimeExceptions',
'/list_accounts', 'ListAccounts',
'/list_rules', 'ListRulesRedirect',
'/r2d2/approve', 'ApproveRules',
'/r2d2/request', 'RequestRule',
'/r2d2/manage_quota', 'RSEAccountUsage',
'/r2d2', 'ListRules',
'/rse', 'RSE',
'/rse/protocol/add', 'AddRSEProtocol',
'/rses', 'RSES',
'/rses/add', 'AddRSE',
'/rse_usage', 'RSEUsage',
'/rse_locks', 'RSELocks',
'/rule', 'Rule',
'/rules', 'Rules',
'/request_rule', 'RequestRuleRedirect',
'/search', 'Search',
'/subscriptions/rules', 'SubscriptionRules',
'/subscription', 'Subscription',
'/subscriptions', 'Subscriptions',
'/subscriptions_editor', 'SubscriptionsEditor',
'/logfiles/load', 'LoadLogfile',
'/logfiles/extract', 'ExtractLogfile',
'/login', 'Login',
'/saml', 'SAML',
'/oidc', 'OIDC',
'/oidc_final', 'FinalizeOIDC',
'/x509', 'X509'
)
POLICY = config_get('policy', 'permission')
ATLAS_URLS = ()
OTHER_URLS = ()
if POLICY == 'atlas':
ATLAS_URLS = (
'/', 'AtlasIndex',
'/account_usage', 'AccountUsage',
'/account_usage_history', 'AccountUsageHistory',
'/dumps', 'Dumps',
'/accounting', 'Accounting',
'/conditions_summary', 'Cond',
'/dbrelease_summary', 'DBRelease',
'/infrastructure', 'Infrastructure',
'/rule_backlog_monitor', 'BacklogMon'
)
else:
OTHER_URLS = (
'/', 'Index'
)
class Account(object):
""" Account info page """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.account())
class AccountUsage(object):
""" Group Account Usage overview """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.account_usage())
class AccountUsageHistory(object):
""" Group Account Usage overview """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.account_usage_history())
class AccountRSEUsage(object):
""" RSE usage per account """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.account_rse_usage())
class AddRSE(object):
""" Add RSE """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.add_rse())
class AddRSEProtocol(object):
""" Add protocol to RSE """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.rse_add_protocol())
class ApproveRules(object):
""" R2D2 rule approval overview """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.approve_rules())
class AtlasIndex(object):
""" Main page """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.atlas_index())
class Auth(object):
""" Local Auth Proxy
serves for changes of account on WebUI when new authentication
token for newly selected account has to be found.
For x509 request a new token directly as all necessary input
is present in the browser. For all other authenticatino mechanisms,
redirect to select_login_method page.
"""
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
# get info about x509 or not and decide
auth_type = cookies().get('x-rucio-auth-type')
if str(auth_type).lower() == 'x509':
token = get_token(get_auth_token_x509)
if token:
header('X-Rucio-Auth-Token', token)
return str()
else:
raise generate_http_error(401, 'CannotAuthenticate', 'Cannot get token')
else:
render = template.render(join(dirname(__file__), 'templates/'))
return render.select_login_method(AUTH_ISSUERS, SAML_SUPPORT)
class X509(object):
""" Local X509 Authentication for Rucio UI """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
data = param_input()
return x509token_auth(data)
class OIDC(object):
""" Local Open ID Connect Authentication for Rucio UI """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
data = param_input()
try:
return oidc_auth(data.account, data.issuer)
except:
raise generate_http_error(401, 'CannotAuthenticate', 'Cannot get token OIDC auth url from the server.')
class FinalizeOIDC(object):
""" Local finalization of Open ID Connect Authentication for Rucio UI """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
session_token = cookies().get('x-rucio-auth-token')
return finalize_auth(session_token, 'OIDC')
class Accounting(object):
""" Accounting """
def GET(self): # pylint:disable=no-self-use,invalid-name
""" GET """
render = template.render(join(dirname(__file__), 'templates/'))
return authenticate(render.accounting())
class BadReplicas(object):
""" Bad replica monitoring """
def GET(self): # pylint:disable=n
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
共158个文件
js:58个
html:51个
png:10个
资源分类:Python库 所属语言:Python 资源全名:rucio-webui-1.22.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
Python库 | rucio-webui-1.22.2.tar.gz (158个子文件)
setup.cfg 617B
ChangeLog 98B
foundation-icons.css 19KB
chosen.css 13KB
chosen.min.css 11KB
multiple-select.css 4KB
rucio.css 3KB
multiple-select2.css 2KB
select_login_method.css 2KB
http_monitoring.css 859B
foundation-icons.eot 53KB
login_icons.eot 3KB
spinner.gif 31KB
request_rule.html 16KB
http_monitoring_account_details.html 11KB
base.html 9KB
http_monitoring_scriptid_details.html 7KB
rse_add_protocol.html 6KB
list_rules.html 6KB
http_api_usage.html 6KB
subscriptions_editor.html 5KB
http_monitoring_index.html 5KB
dumps.html 5KB
login.html 5KB
http_monitoring_apiclass_details.html 4KB
http_monitoring_accounts.html 4KB
add_rse.html 4KB
select_login_method.html 4KB
approve_rules.html 4KB
rse.html 4KB
account.html 4KB
http_monitoring_apiclasses.html 3KB
http_monitoring_resources.html 3KB
http_monitoring_scriptids.html 3KB
lifetime_exception.html 3KB
no_certificate.html 3KB
suspicious_replicas.html 3KB
backlog_mon.html 3KB
dbrelease.html 3KB
cond.html 2KB
did.html 2KB
rse_account_usage.html 2KB
search.html 2KB
rules.html 2KB
rule.html 2KB
account_usage.html 2KB
infrastructure.html 2KB
rses.html 2KB
bad_replicas_summary.html 1KB
subscriptions.html 1KB
rse_locks.html 1KB
rse_usage.html 1KB
account_rse_usage.html 1KB
list_lifetime_exceptions.html 1KB
heartbeats.html 1KB
account_usage_history.html 1KB
bad_replicas.html 1KB
subscription.html 953B
accounts.html 886B
subscriptionrules.html 863B
problem.html 756B
accounting.html 749B
atlas_index.html 519B
index.html 471B
favicon.ico 1KB
MANIFEST.in 421B
error.jpg 83KB
rucio.js 62KB
request_rule.js 49KB
chosen.proto.js 44KB
chosen.jquery.js 44KB
did.js 43KB
chosen.proto.min.js 28KB
chosen.jquery.min.js 28KB
rule.js 23KB
rse_account_usage.js 23KB
jquery.multiple.select.js 23KB
jquery.multiple.select2.js 20KB
backlog_mon.js 15KB
subscriptions_editor.js 14KB
list_rules.js 13KB
bad_replicas_summary.js 12KB
http_monitoring_account_details.js 12KB
lifetime_exception.js 12KB
approve_rules.js 12KB
account_usage.js 12KB
rse_usage.js 11KB
suspicious_replicas.js 10KB
http_monitoring_utils.js 10KB
http_monitoring_scriptid_details.js 9KB
account_rse_usage.js 8KB
subscription.js 8KB
account_usage_history.js 7KB
base.js 7KB
rse.js 7KB
jquery.storageapi.min.js 7KB
account.js 7KB
rse_locks.js 6KB
rse_add_protocol.js 6KB
search.js 6KB
共 158 条
- 1
- 2
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功