The oslo.context base class already supports is_admin and roles
attributes. This patch removes unnecessary overrides. It also fixes
inconsistency in tests, where some of the parameters, passed to the
dummy_context were not passed to the resulting RequestContext.
Co-Authored-By: Kirill Zaitsev <k.zaitsev@me.com>
Change-Id: Idf979528b9d9df3305ba1994009367061fd4f413
Since Glare support was introduced the 'catalog/packages' part of
Murano API (/v1/catalog/packages) became obsolete and was intended to
be used for "legacy" (i.e. non-glare-based) package storage. The
murano client was supposed to directly call glare to retrieve the
packages.
However, the "GetPackageUI" call (GET
/v1/catalog/packages/%pkg_id%/ui) is different: not all the packages
bundle the UI definitions, some require Murano to generate them based
on the contents of the package. This is true for HOT-based packages
and others, plugin-based ones. In future this will be true for 100% of
the packages when the dynamic ui and object model generation is added.
Because of this that API should be callable even if Glare is
configured as a package storage backend. It should fetch the artifact
from glare, unpack it and use whatever plugin-specific logic required
to generate the UI definitions for this particular package.
This patch introduces appropriate change while maintaining the
backwards compatibility: in the legacy mode (i.e. when murano's DB
acts as package storage) the UI is read directly from an appropriate
DB table without fetching the whole package.
This fixes the issue when the HOT-based packages could not be
deplpoyed properly with murano-dashboard, but the murano-client has to
be updated as well to properly call the modified API even if Glare is
enabled.
Change-Id: Id9327e4015e1c0a1553c0b1a0151a94ee4da2928
Partial-bug: #1565805
In Ia575ba803a0fb70f39146bd75d381ed19414bd23, oslo.context (2.2.0)
added roles support in the context itself. This passes roles to
super()__init__ and uses the default to_dict().
Depends-On: I79ea029ceb67173e69631b4e6e614fa62e159227
Change-Id: I1807f19aa867f17c055bb018b6cce6f569f90ca4
Old versions of oslo_context do not include rules in to_dict()
However roles are required for newer versions of oslo_policy to operate
and resolve 'role:xxx' rules.
Since minimal version for oslo_context is 0.2.0 and commit, that adds
roles has been added only in 2.2.0 we should support old versions of
oslo_context with newer version.
Change-Id: If35726613bec5d342bad72b542215ec8e5c096a2
Closes-Bug: #1552291
Before murano used RequestContext, inherited from object.
oslo_context has graduated and includes a bunch of features, that is
used by oslo_log and other oslo modules.
In particular this commit enables logging of request_id, user_id and
tenant_id in all context-aware requests.
Alters tests tto make them pass regardless of the new context.
Targets blueprint: murano-x-openstack-request-id-support
Change-Id: Ic22f67ae89881581254de8787fa3632dfa1af08f
* Set admin rule for a several API calls and remove direct check in code
* Now admin can configure policy.json and enable package management for regular users
* Update common policy module
Closes-Bug: #1412868
Change-Id: I8d0725b613564529d32a5acef289f4822f32915c
* H202 assertRaises Exception too broad
* H402 one line docstring needs punctuation
* H404 multi line docstring should start without a leading new line
Change-Id: I2f662b8b97d14daa501620c8237bf93bd2251243
Adds ability for deploy-time auth checks to allow/disallow
functionality, in line with other openstack projects.
Includes update of code in openstack/common, which is why the
patchset is so large. oslo-incubator changeset is May 27th
caed79d8239679cb74476bb0d9e5011b4fcc39da.
Implements blueprint policy-checks-in-api
Change-Id: I67a431dcc74f0a77ed48b7a489136d5008773cea