コード例 #1
0
ファイル: server.py プロジェクト: CERT-Polska/mwdb-core
    def get(self):
        """
        ---
        summary: Get extended server information
        description: |
            Returns information about extra flags and installed plugins

            Requires any administration capability (manage_users)
        security:
            - bearerAuth: []
        tags:
            - server
        responses:
            200:
              description: Server extended information
              content:
                application/json:
                  schema: ServerAdminInfoResponseSchema
            403:
              description: When user doesn't have any of required capabilities
        """

        schema = ServerAdminInfoResponseSchema()
        return schema.dump({
            "rate_limit_enabled": app_config.mwdb.enable_rate_limit,
            "plugins_enabled": app_config.mwdb.enable_plugins,
            "active_plugins": get_plugin_info(),
        })
コード例 #2
0
ファイル: server.py プロジェクト: xorhex/mwdb-core
 def get(self):
     """
     ---
     summary: Get server information
     description: Returns server information with public configuration
     tags:
         - server
     responses:
         200:
           description: Server info with public configuration
           content:
             application/json:
               schema: ServerInfoResponseSchema
     """
     schema = ServerInfoResponseSchema()
     return schema.dump({
         "server_version": app_build_version,
         "is_authenticated": bool(g.auth_user),
         "is_maintenance_set": app_config.mwdb.enable_maintenance,
         "is_registration_enabled": app_config.mwdb.enable_registration,
         "recaptcha_site_key": app_config.mwdb.recaptcha_site_key,
         "base_url": app_config.mwdb.base_url,
         "active_plugins": get_plugin_info(),
         "remotes": app_config.mwdb.remotes,
     })
コード例 #3
0
 def get(self):
     """
     ---
     summary: Get plugin information
     description: Returns information about installed plugins
     security:
         - bearerAuth: []
     tags:
         - server
     responses:
         200:
           description: Server plugin info with public configuration
           content:
             application/json:
               schema: ServerInfoResponseSchema
     """
     schema = ServerPluginInfoResponseSchema()
     return schema.dump({"active_plugins": get_plugin_info()})