Changeset View
Changeset View
Standalone View
Standalone View
swh/web/common/forge_add.py
- This file was added.
# Copyright (C) 2021 The Software Heritage developers | |||||
# See the AUTHORS file at the top-level directory of this distribution | |||||
# License: GNU Affero General Public License version 3, or any later version | |||||
# See top-level LICENSE file for more information | |||||
from typing import List | |||||
def get_forge_types(privileged_user: bool = False) -> List[str]: | |||||
"""Retrieve the allowed list of forge types users can request. | |||||
Args: | |||||
privileged_user: Whether the user is privileged (True) or not (False). | |||||
Returns: | |||||
The list of supported forge to request for listing. | |||||
""" | |||||
# FIXME: Determine where to store such information | |||||
hardcoded_types = ["gitlab", "heptapod", "cgit", "launchpad", "opam"] | |||||
hardcoded_types.sort() | |||||
return hardcoded_types |