Skip to content

BUG: ScanCode.io API Key cannot be added to dataspace due to model constraint violation (max length 40 characters) #517

@marcoberger

Description

@marcoberger

Describe the bug
Hi there,
I assume that this bug is related to the improved storage of API Keys in the database in aboutcode-org/scancode.io#2087. Once you use this version of ScanCode.io it generates API key with a length of 64 characters. This API Key can no longer be saved in a Dejacode dataspace, due to the length restriction in the django model for the API Key (which is 40 characters apparently).

To Reproduce
Steps to reproduce the behavior:

  1. Go to dataspace configuration
  2. Enter a ScanCode.io API Key of length 64 like 1d3377ff1094f10d197c7684f61ee31a1cb4b64eacf080564a3b6a97ds774fa4
  3. Click on 'Save'
  4. See the validation error 'Ensure this value has at most 40 characters (it has 64).'

Expected behavior
The dataspace configuration should be saved without error.

Screenshots
Hopefully, not necessary.

See lines of code in model.py ->

scancodeio_api_key = models.CharField(

Context (OS, Browser, Device, etc.):
Not applicable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdesign neededDesign details needed to complete the issueenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions