theupdateframework / theupdateframework/python-tuf
ngclient: Make updater.config immutable
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 304
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 17
Descripción
This comes from #2363 / #2359 : we should make the config somehow immutable once it's been used by Updater. This should be a difficult mistake to make:
updater = Updater(...)
updater.refresh()
updater.config.offline = True
(the issue is refresh() already used config.offline: the value can't be changed during lifetime of Updater. Likely this makes sense for all config)
I originally suggested reading the updater.config.offline value only once during initialization, but that still makes writing the above code possible. Would be better if it failed linting.
I suppose two possible actions:
- Updater.config becomes a read only property (or not public at all)
- Could make UpdaterConfig
frozen=Trueas well
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza rastreando Updater.config y UpdaterConfig a través de refresh(), usando el ejemplo del issue para identificar cuándo se lee la configuración. Compara la propiedad de solo lectura y las opciones de configuración congelada; después, verifica que la configuración no pueda cambiarse una vez que Updater la haya usado y que el comportamiento existente siga estando cubierto.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- api, backend
- Tipo de issue
- Refactorización
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100