prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add user principals to hello view
  Along `user` info, show the list of user principals (for groups notably)
  
  
  </issue>
  <code>
  [start of kinto/core/views/hello.py]
  1 from pyramid.security import NO_PERMISSION_REQUIRED, Authenticated
  2 
  3 from kinto.core import Service
  4 
  5 hello = Service(name="hello", path='/', description="Welcome")
  6 
  7 
  8 @hello.get(permission=NO_PERMISSION_REQUIRED)
  9 def get_hello(request):
  10     """Return information regarding the current instance."""
  11     settings = request.registry.settings
  12     project_name = settings['project_name']
  13     project_version = settings['project_version']
  14     data = dict(
  15         project_name=project_name,
  16         project_version=project_version,
  17         http_api_version=settings['http_api_version'],
  18         project_docs=settings['project_docs'],
  19         url=request.route_url(hello.name)
  20     )
  21 
  22     eos = get_eos(request)
  23     if eos:
  24         data['eos'] = eos
  25 
  26     data['settings'] = {}
  27     public_settings = request.registry.public_settings
  28     for setting in list(public_settings):
  29         data['settings'][setting] = settings[setting]
  30 
  31     # If current user is authenticated, add user info:
  32     # (Note: this will call authenticated_userid() with multiauth+groupfinder)
  33     if Authenticated in request.effective_principals:
  34         data['user'] = request.get_user_info()
  35 
  36     # Application can register and expose arbitrary capabilities.
  37     data['capabilities'] = request.registry.api_capabilities
  38 
  39     return data
  40 
  41 
  42 def get_eos(request):
  43     return request.registry.settings['eos']
  44
  [end of kinto/core/views/hello.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/kinto/core/views/hello.py b/kinto/core/views/hello.py
  --- a/kinto/core/views/hello.py
  +++ b/kinto/core/views/hello.py
  @@ -32,6 +32,12 @@
       # (Note: this will call authenticated_userid() with multiauth+groupfinder)
       if Authenticated in request.effective_principals:
           data['user'] = request.get_user_info()
  +        principals = request.effective_principals + [request.prefixed_userid]
  +        prefix, user_id = request.prefixed_userid.split(':', 1)
  +        # Remove unprefixed user id on effective_principals to avoid conflicts.
  +        if user_id in principals:
  +            principals.remove(user_id)
  +        data['user']['principals'] = principals
   
       # Application can register and expose arbitrary capabilities.
       data['capabilities'] = request.registry.api_capabilities
  
verification_info: {"golden_diff": "diff --git a/kinto/core/views/hello.py b/kinto/core/views/hello.py\n--- a/kinto/core/views/hello.py\n+++ b/kinto/core/views/hello.py\n@@ -32,6 +32,12 @@\n     # (Note: this will call authenticated_userid() with multiauth+groupfinder)\n     if Authenticated in request.effective_principals:\n         data['user'] = request.get_user_info()\n+        principals = request.effective_principals + [request.prefixed_userid]\n+        prefix, user_id = request.prefixed_userid.split(':', 1)\n+        # Remove unprefixed user id on effective_principals to avoid conflicts.\n+        if user_id in principals:\n+            principals.remove(user_id)\n+        data['user']['principals'] = principals\n \n     # Application can register and expose arbitrary capabilities.\n     data['capabilities'] = request.registry.api_capabilities\n", "issue": "Add user principals to hello view\nAlong `user` info, show the list of user principals (for groups notably)\n\n", "before_files": [{"content": "from pyramid.security import NO_PERMISSION_REQUIRED, Authenticated\n\nfrom kinto.core import Service\n\nhello = Service(name=\"hello\", path='/', description=\"Welcome\")\n\n\n@hello.get(permission=NO_PERMISSION_REQUIRED)\ndef get_hello(request):\n    \"\"\"Return information regarding the current instance.\"\"\"\n    settings = request.registry.settings\n    project_name = settings['project_name']\n    project_version = settings['project_version']\n    data = dict(\n        project_name=project_name,\n        project_version=project_version,\n        http_api_version=settings['http_api_version'],\n        project_docs=settings['project_docs'],\n        url=request.route_url(hello.name)\n    )\n\n    eos = get_eos(request)\n    if eos:\n        data['eos'] = eos\n\n    data['settings'] = {}\n    public_settings = request.registry.public_settings\n    for setting in list(public_settings):\n        data['settings'][setting] = settings[setting]\n\n    # If current user is authenticated, add user info:\n    # (Note: this will call authenticated_userid() with multiauth+groupfinder)\n    if Authenticated in request.effective_principals:\n        data['user'] = request.get_user_info()\n\n    # Application can register and expose arbitrary capabilities.\n    data['capabilities'] = request.registry.api_capabilities\n\n    return data\n\n\ndef get_eos(request):\n    return request.registry.settings['eos']\n", "path": "kinto/core/views/hello.py"}]}