292052912c
Add test for extracting ar archive without long filenames
2024-08-27 11:28:44 +02:00
a887ade78f
Fix possibility to overwrite special files in .osc (CVE-2024-22034 boo#1225911)
...
Source files are now stored in the 'sources' subdirectory which prevents
name collisons. This requires changing version of '.osc' store to 2.0.
2024-07-29 13:24:13 +02:00
52f076636d
Make most of the fields in KeyinfoPubkey and KeyinfoSslcert models optional
...
The presence of the fields seems to be random and the only truly required field
is the actual public key/cert. Other fields are only for the information.
2024-07-04 14:24:52 +02:00
4d1651d038
Fix colorize() to avoid wrapping empty string into color escape sequences
2024-07-04 14:24:52 +02:00
b8e187cc70
Fix tests so they don't modify fixtures
2024-06-25 08:48:45 +02:00
5c3cca63c4
Run check_store_version() in obs_scm.Store and fix related code in Project and Package
2024-06-24 12:37:15 +02:00
661bc7757c
Use f-strings where possible
2024-06-18 10:26:36 +02:00
360a94c4a3
Fix config parser to throw an exception on duplicate sections or options
2024-06-03 08:21:17 +02:00
5cbd110a84
Forbid extracting files with absolute path from 'cpio' archives (boo#1122683)
...
Also fix and modernize the code, add tests.
2024-05-30 14:53:58 +02:00
d61b781976
Forbid extracting files with absolute path from 'ar' archives (boo#1122683)
...
Also fix and modernize the code, add tests.
2024-05-30 14:53:58 +02:00
23fe42be30
Fix handling the default package argument on the command-line
...
If the project was explicitly specified from the command-line,
avoid using the default package because that would be frequently
obtained from the current working copy and that leads to unexpected results.
2024-04-18 10:32:29 +02:00
eb2678e0c7
Fix XmlModel to load an empty string in an int field as None
2024-04-17 10:57:59 +02:00
d1111e23a1
Fix output.safe_write() in connection with NamedTemporaryFile
...
Fixes: AttributeError: '_io.BufferedRandom' object has no attribute 'buffer'
2024-04-17 10:57:59 +02:00
f9b17347da
Improve sanitize_text() to keep selected CSI escape sequences
2024-03-07 17:30:29 +01:00
88f7dc517b
Extend output.print_msg() to accept 'error' and 'warning' values of 'to_print' argument
2024-03-05 16:45:52 +01:00
866d178345
Move print_msg() to the 'osc.output' module
2024-03-05 16:45:52 +01:00
28326a185d
Add XPathQuery class for translating keyword arguments to an xpath query
2024-03-05 10:06:21 +01:00
cd95478ac8
Implement total ordering on BaseModel
2024-03-04 15:00:12 +01:00
747eb0ec52
Allow storing apiurl in the XmlModel instances
2024-03-04 14:58:40 +01:00
9cce6dbb8e
Allow retrieving default field value from top-level model
2024-03-04 14:58:40 +01:00
7768684461
Fix BaseModel to convert dictionaries to objects on retrieving a model list
2024-02-23 13:14:04 +01:00
ab36108871
Implement do_snapshot() and has_changed() methods to determine changes in BaseModel
2024-02-21 09:46:53 +01:00
e5774a5730
Add XmlModel class that encapsulates manipulation with XML
2024-02-21 09:46:53 +01:00
0f8a8430fc
Remove all path quoting, rely on makeurl()
2024-02-09 13:26:37 +01:00
3f14cef53a
Refactor makeurl(), deprecate query taking string or list arguments, drop osc_urlencode()
2024-02-09 13:26:37 +01:00
c7af0e458f
Use Field.get_callback to handle quiet/verbose and http_debug/http_full_debug options
2024-01-24 15:47:37 +01:00
8a38a9da82
Implement get_callback that allows modifying returned value to the Field class
2024-01-24 15:47:37 +01:00
a8c7661627
Implement 'quiet' conf option
2024-01-24 15:47:37 +01:00
01036341d4
Merge pull request #1473 from dmach/nested-models
...
Support nested models + related fixes
2024-01-23 21:09:35 +01:00
0413179709
Fix Password.encode() on python < 3.8
2024-01-23 20:07:13 +01:00
7903ade2b4
Add support for List[BaseModel] type to Field class
2024-01-23 20:05:38 +01:00
b4a1b29f57
Fix exporting an empty model field in BaseModel.dict()
2024-01-23 20:05:28 +01:00
35433fc341
Implement 'Enum' support in models
2024-01-23 20:05:17 +01:00
82216c72b4
Implement reading credentials from environmental variables
...
Options for apiurls can be set via OSC_HOST_<ALIAS>_<OPTION>=...
This requires a configured alias in the config file.
Setting the default apiurl via OSC_APIURL=... was working already.
Also OSC_CONFIG= / --config= was already implemented to skip loading configuration entirely.
Options for the default apiurl can be now set via:
OSC_USERNAME=...
OSC_CREDENTIALS_MGR_CLASS=...
OSC_PASSWORD=...
This, for example, makes running osc in containers with
credentials stored in environmental variables possible:
OSC_CONFIG= OSC_APIURL=<url> OSC_USERNAME=<user> OSC_PASSWORD=<password> osc ...
2024-01-08 15:21:45 +01:00
b8d6c949c9
Drop unused 'exclude_unset' argument from BaseModel.dict() method
2024-01-04 10:20:58 +01:00
16cdc067a5
Store cached model defaults in self._defaults, avoid sharing references to mutable defaults
2024-01-03 21:22:30 +01:00
587c094f61
Limit model attributes to predefined fields by forbidding creating new attributes on fly
2024-01-03 21:21:38 +01:00
608fc76cd2
docs: Update models to avoid including lazy defaults in the rendered man pages
...
Lazy defaults may return different results under different circumstances
and we always want man pages rendered consistently.
2023-12-01 16:22:13 +01:00
69a68b06b3
Fix conf.write_initial_config() to use read_file() instead of deprecated readfp()
2023-11-15 09:18:22 +01:00
c790134aa4
Fix apiurl_aliases handling in OscOptions.__getitem__
2023-10-24 00:33:21 +02:00
a2e7383eca
Allow undefined fields in Options and HostOptions
...
Plugins seem to be using oscrc and osc.conf.config to store their config options.
All fields that are not known to osc are now stored in the 'extra_fields' dictionary
and handled in __getitem__() and __setitem__() as they were regular fields.
Such values are not checked for their types and the dictionary simply holds
strings obtained from oscrc or anything the plugins set through the python API.
2023-10-19 14:23:33 +02:00
268424797a
Fix retrieving config values in core.vc_export_env()
2023-10-13 20:34:09 +02:00
c6900f96d1
tests: Replace 'git init -b' with 'git init' and 'git checkout -b'
2023-10-10 08:32:57 +02:00
ee725ff51b
Fix a crash in 'Fix handling empty vm_type in Store.last_buildroot' when last_buildroot is empty
2023-09-25 14:41:17 +02:00
93cfb76a46
Fix handling empty vm_type in Store.last_buildroot
2023-09-25 10:16:00 +02:00
848f5fe48f
Switch 'osc.conf.config' from dict to Options class with type checking
2023-09-11 21:14:45 +02:00
930b7a8a4e
Add 'osc.util.models' module implementing an alternative pydantic-like data validation
2023-09-11 21:11:05 +02:00
Tammo Oepkes
b9014ccd56
Fix api_host_options for custom CAs ( #1403 )
2023-09-11 21:06:34 +02:00
f9dc3122f9
Add more config options among integer options
2023-08-15 14:29:18 +02:00
7ad815a149
tests: Fix TestMirrorGroup to load oscrc from fixtures
2023-08-09 13:07:06 +02:00