Skip to content

Conversation

@Caleb-Hill
Copy link
Contributor

No description provided.

@github-actions github-actions bot added backport-triage It has not yet been determined if this branch should be backported. main labels Jul 29, 2022
@Caleb-Hill Caleb-Hill force-pushed the move_rest_api branch 3 times, most recently from e129ca4 to 304960a Compare July 29, 2022 16:13
This commit adds a feature guard around the new_unchecked fn in the rbac
assignment store.

Signed-off-by: Caleb Hill <hill@bitwise.io>
OAuth integration tests make heavy use of the OAuthClient struct as you
might expect. Those integration tests are moving to the rest_api crates
because they also use actix-web specific code. This presents a problem
in that there wasn't a way to construct a client outside of libsplinter.

This commit makes the OAuthClient constructor public so it can be used
in the actix_web_1 crate.

Signed-off-by: Caleb Hill <hill@bitwise.io>
This commit adds a constructor and a getter used by some tests in the
splinter_rest_api_actix_web_1 crate.

Signed-off-by: Caleb Hill <hill@bitwise.io>
This commit adds the log,rand, and jsonwebtoken dependencies to common.
Those crates are used by code moving into this crate.

Signed-off-by: Caleb Hill <hill@bitwise.io>
This commit moves all actix-web and supporting rest-api code into the
actix-web-1 and common crates.

The main discriminant is 'does this have actix-web-1 stuff in it' =>
actix-web-1 else common.

Below is an accounting of where things moved from
libsplinter/src/rest_api. This commit encompasses these moves as well as
updating everything in the rest_api and splinterd crates to import
structs from the right places.

1 auth
======

1.1 identity => rest_api/common/auth/identity
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1.1.1 biome.rs
--------------

1.1.2 cylinder.rs
-----------------

1.1.3 mod.rs
------------

1.1.4 oauth.rs
--------------

1.2 mod.rs => rest_api/common/auth/{authorization_result, authorization_header, bearer_token}.mod.rs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1.3 actix.rs => rest_api/actix_web_1/auth/{transform,middleware}.rs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1.4 authorization
~~~~~~~~~~~~~~~~~

1.4.1 permission_map.rs => Split between common/auth/permission_map.rs and  actix_web_1/auth/method.rs
------------------------------------------------------------------------------------------------------

1.4.2 rbac
----------

* 1.4.2.1 handler.rs => common/auth/rbac/handler.rs

* 1.4.2.2 mod.rs

* 1.4.2.3 rest_api

  + 1.4.2.3.1 resources => common/auth/rbac/resources

    - 1.4.2.3.1.1 roles.rs

    - 1.4.2.3.1.2 mod.rs

    - 1.4.2.3.1.3 assignments.rs

  + 1.4.2.3.2 mod.rs => delete

  + 1.4.2.3.3 actix_web_1 => actix_web_1/auth/rbac

    - 1.4.2.3.3.1 error.rs => common/auth/rbac/error.rs

    - 1.4.2.3.3.2 roles.rs

    - 1.4.2.3.3.3 mod.rs

    - 1.4.2.3.3.4 assignments.rs

1.4.3 mod.rs => common/auth/{permission,authorization_handler_result,authorization_handler}.rs
----------------------------------------------------------------------------------------------

* 1.4.3.1 Split

* 1.4.3.2 Move

1.4.4 maintenance
-----------------

* 1.4.4.1 mod.rs => split common/auth/maintenance/{maintenance_mode_authorization_handler,mod}.rs

  + 1.4.4.1.1 Split

  + 1.4.4.1.2 Move

* 1.4.4.2 routes

  + 1.4.4.2.1 actix.rs => actix-web-1/auth/maintenance/routes.rs

  + 1.4.4.2.2 mod.rs => actix-web-1/auth/maintenance/mod.rs

  + 1.4.4.2.3 resources.rs => common/auth/maintenance/

1.4.5 allow_keys.rs => common/auth/allow_keys.rs
------------------------------------------------

1.4.6 routes
------------

* 1.4.6.1 mod.rs => actix-web/actix-web-1/routes/resource_provider.rs

* 1.4.6.2 actix.rs => actix-web/actix-web/routes/make_permissions_resource.rs

* 1.4.6.3 resources.rs => common/auth/routes?/resources.rs

2 secrets => common/auth/secrets
================================

2.1 error.rs
~~~~~~~~~~~~

2.2 mod.rs
~~~~~~~~~~

2.3 auto_secret_manager.rs
~~~~~~~~~~~~~~~~~~~~~~~~~~

3 cors.rs => actix-web-1/auth/cors.rs
=====================================

4 response_models.rs => common/response_models.rs
=================================================

5 paging.rs => delete, already exists in common
===============================================

6 mod.rs => Split common/{OauthConfig,bind_config,mod}.rs
=========================================================

7 sessions => common/sessions/
==============================

7.1 claims.rs
~~~~~~~~~~~~~

7.2 token_issuer.rs
~~~~~~~~~~~~~~~~~~~

7.3 error.rs
~~~~~~~~~~~~

7.4 mod.rs
~~~~~~~~~~

8 errors.rs => common/auth/error.rs
===================================

Signed-off-by: Caleb Hill <hill@bitwise.io>
@Caleb-Hill Caleb-Hill removed the backport-triage It has not yet been determined if this branch should be backported. label Jul 29, 2022
@Caleb-Hill Caleb-Hill marked this pull request as ready for review July 29, 2022 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants