OAuth2 support 99/12899/9
authorksun1 <kaige.sun@windriver.com>
Tue, 16 Apr 2024 08:06:29 +0000 (16:06 +0800)
committerZhang Rong(Jon) <rong.zhang@windriver.com>
Mon, 27 May 2024 13:58:22 +0000 (21:58 +0800)
commitd7c14ad6506b2f1a85246c9e1d08d0d64e9df7f2
treed7b5bce741090d064ba7e404e70468f74365c822
parent116a47fff82b8c77036d07094cb71151d13bfe7f
OAuth2 support

The WG11 Security Requirements v04.00.01 specify that the API should
follow OAuth 2.0. However, the O2 IMS API is not compliant with OAuth
2.0.
This commit will add OAuth 2.0 support to the O2 IMS API. The OAuth
2.0 server is based on a third-party service, and the O2 IMS will be
registered with the OAuth server to enable OAuth functionality.

Test Plan:
1. Start O2 with the third-party OAuth server. Verify that requests
   with tokens assigned by the third-party server are authenticated
   successfully by O2 IMS.
2. Start O2 with the original K8S authentication and verify that it
   is successful.

Issue-ID: INF-447

Change-Id: I8c3cf9ce297b8404cea60c24a1d50b0fb17107a0
Signed-off-by: Kaige Sun <kaige.sun@windriver.com>
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
configs/o2app.conf
o2app/entrypoints/flask_application.py
o2common/authmw/authmiddleware.py
o2common/authmw/authprov.py
o2common/authmw/exceptions.py [new file with mode: 0644]
o2common/config/config.py
requirements.txt