Skip to content

Release #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 69 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
4e6b9eb
Fix develop dockerfile
Jul 5, 2023
918d4c6
Change keycloak urls
Jul 5, 2023
ba4b8b6
Fix develop workflow tag
Jul 5, 2023
5796045
Fix production workflow
Jul 5, 2023
9f4d9c2
Change log message
Jul 5, 2023
45704b4
Change config
Jul 5, 2023
8fefb80
Add health check
Jul 5, 2023
e2b6f3f
Fix health check
Jul 5, 2023
e9b702d
Add ready health endpoint
Jul 5, 2023
7ad7d20
Fix issue
Jul 5, 2023
94c2d7e
Change workflow filenames
Jul 5, 2023
4667b27
Eoepca 910 um keycloak develop an identity api based on keycloak api …
flaviorosadme Jul 25, 2023
e8f2581
Update README
Aug 21, 2023
7726408
Merge branch 'develop' of https://github.com/EOEPCA/um-identity-api i…
Aug 21, 2023
6743f64
Update config
Sep 26, 2023
f9c6a84
Update config
Sep 26, 2023
8468ce0
Update config
Sep 26, 2023
c170db2
Api testing (#18)
flaviorosadme Oct 9, 2023
cf2d35a
Update ci
Oct 10, 2023
5eecb1e
Update ci
Oct 10, 2023
b6a0828
Release v1.0.0
Oct 15, 2023
197b1c0
Fix ci
Oct 15, 2023
85b8f27
Fix requirements
Oct 15, 2023
5aace57
Fix ci
Oct 15, 2023
f0ac15a
Merge branch 'master' into develop
daniel-pimenta-DME Oct 15, 2023
e5559d5
Upgrade flask version
Oct 15, 2023
b86284c
Merge branch 'develop' of https://github.com/EOEPCA/um-identity-api i…
Oct 15, 2023
df2ec57
Update requirements
Oct 15, 2023
de3ee6c
Merge branch 'master' into develop
daniel-pimenta-DME Oct 15, 2023
c19db10
feat: added error handling (#23)
flaviorosadme Oct 16, 2023
7fda506
feat: added validator of register and protect resource enpoint to test
flaviorosadme Oct 18, 2023
9d51ae6
Merge branch 'develop' of https://github.com/EOEPCA/um-identity-api i…
flaviorosadme Oct 18, 2023
ffe7a1d
feat: register and protect resources endpoint working
flaviorosadme Oct 19, 2023
a8c62a6
feat: added delete resources, policies and permissions
flaviorosadme Oct 20, 2023
734244e
Update ci
Oct 23, 2023
2de9bfd
Merge branch 'develop' of https://github.com/EOEPCA/um-identity-api i…
Oct 23, 2023
acc4fed
Update ci
Oct 23, 2023
004b489
Fix ci
Oct 24, 2023
9d8c034
Add options method to endpoints
Oct 29, 2023
e5cdcae
Merge branch 'master' into develop
daniel-pimenta-DME Oct 29, 2023
82a5a5f
feat: added endpoint to create client, add resources and protect them…
flaviorosadme Nov 8, 2023
9ad30a0
Merge branch 'develop' of https://github.com/EOEPCA/um-identity-api i…
flaviorosadme Nov 8, 2023
deb3afe
Revert "Add options method to endpoints"
flaviorosadme Nov 8, 2023
63089e0
Merge remote-tracking branch 'origin/master' into develop
flaviorosadme Nov 8, 2023
b3514a6
fea: commit fixes
flaviorosadme Nov 8, 2023
2d6426c
feat: more fixes, some endpoint were dounbled
flaviorosadme Nov 8, 2023
8d77748
fix: last fix
flaviorosadme Nov 8, 2023
7d57858
Update ci
Nov 9, 2023
928816d
Merge branch 'develop' of https://github.com/EOEPCA/um-identity-api i…
Nov 9, 2023
11cae2f
fix: policies fix, response now return client id and resources created
flaviorosadme Nov 10, 2023
31e1db0
feat: create client default to confidential and authorization enabled
flaviorosadme Nov 14, 2023
9d3aae1
Convert to FastAPI
Nov 14, 2023
8a8dba0
Merge branch 'develop' of https://github.com/EOEPCA/um-identity-api i…
Nov 14, 2023
5931be4
Convert to FastAPI
Nov 14, 2023
f4d31c5
changes to models
flaviorosadme Nov 14, 2023
025490c
Remove file
Nov 14, 2023
c5a0042
Add error handling, pydantic models, files restructuring
Nov 15, 2023
32303ec
Fix issues
Nov 15, 2023
4c5f607
Handle keycloak error message
Nov 15, 2023
fd9b791
added fildes to models and descriptions
flaviorosadme Nov 16, 2023
5030bc6
Add authenticated field
Nov 16, 2023
4501347
Clean and reformat
Nov 16, 2023
935e825
Point to keycloak client 1.0.0
Nov 16, 2023
0389d15
Change logging
Nov 16, 2023
c6c3904
Fix readme
Nov 16, 2023
e92f49b
Clean
Nov 16, 2023
a2fb5d8
Change logging
Nov 16, 2023
774cf8f
Clean
Nov 16, 2023
077df14
Merge branch 'master' of https://github.com/EOEPCA/um-identity-api in…
Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*
!src
!conf
!app
!requirements.*
!.flaskenv
!config.ini
!logging.yaml
3 changes: 0 additions & 3 deletions .flaskenv

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,4 @@ env/
.vscode

.idea
postgres
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

18 changes: 7 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
FROM python:alpine
RUN apk add --no-cache git
RUN mkdir /app
WORKDIR /app
COPY . .
ENV FLASK_APP "src/app:create_app()"
ENV FLASK_ENV local
ENV FLASK_DEBUG 1
RUN pip install -r requirements.txt
EXPOSE 5566
CMD [ "python", "-m" , "flask", "run", "--host=0.0.0.0", "--port=5566"]
FROM python:3.12
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./config.ini /code/config.ini
COPY ./app /code/app
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "8080"]
120 changes: 51 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
<!-- PROJECT SHIELDS -->
<!--
*** See the bottom of this document for the declaration of the reference variables
*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.
*** https://www.markdownguide.org/basic-syntax/#reference-style-links
-->

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]
![Build][build-shield]

<!-- PROJECT LOGO -->
<br />
<p align="center">
<a href="https://github.com/EOEPCA/um-identity-api">
<img src="images/logo.png" alt="Logo" width="80" height="80">
</a>

<h3 align="center">Identity API</h3>

<p align="center">
Flask application to enable a REST API server to manage Keycloak through Keycloak Admin API (https://www.keycloak.org/docs-api/21.0.1/rest-api/index.html) and Protection API (https://www.keycloak.org/docs/latest/authorization_services/index.html#_service_protection_api).
FastAPI application exposing a Restful API to manage Keycloak through Keycloak Admin API (https://www.keycloak.org/docs-api/22.0.1/rest-api/index.html) and Protection API (https://www.keycloak.org/docs/latest/authorization_services/index.html#_service_protection_api).
<br />
<a href="https://github.com/EOEPCA/um-identity-api"><strong>Explore the docs »</strong></a>
<br />
<a href="https://github.com/EOEPCA/um-identity-api">View Demo</a>
·
<a href="https://github.com/EOEPCA/um-identity-api/issues">Report Bug</a>
·
<a href="https://github.com/EOEPCA/um-identity-api/issues">Request Feature</a>
</p>
</p>

## Table of Contents
Expand All @@ -42,120 +29,105 @@
- [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Testing](#testing)
- [Documentation](#documentation)
- [Usage](#usage)
- [Running the template service](#running-the-template-service)
- [Upgrading Gradle Wrapper](#upgrading-gradle-wrapper)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
- [Acknowledgements](#acknowledgements)

<!-- ABOUT THE PROJECT -->

## About The Project

Flask application to enable a REST API server to manage Keycloak through Keycloak Admin API (https://www.keycloak.org/docs-api/21.0.1/rest-api/index.html) and Protection API (https://www.keycloak.org/docs/latest/authorization_services/index.html#_service_protection_api).
FastAPI application exposing a Restful API to manage Keycloak through Keycloak Admin
API (https://www.keycloak.org/docs-api/21.0.1/rest-api/index.html) and Protection
API (https://www.keycloak.org/docs/latest/authorization_services/index.html#_service_protection_api).

Includes three main paths:
- **Resources** - CRUD operations to manage resources
- **Policies** - CRUD operations to manage policies
- **Permissions** - CRUD operations to manage permissions
Swagger docs are available at /docs.
Redoc docs are available at /redoc.

### Built With

- [Python](https://www.python.org//)
- [PyTest](https://docs.pytest.org)
- [YAML](https://yaml.org/)
- [Travis CI](https://travis-ci.com/)

<!-- GETTING STARTED -->
- [Python](https://www.python.org)
- [FastAPI](https://fastapi.tiangolo.com)

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

This is an example of how to list things you need to use the software and how to install them.

- [Docker](https://www.docker.com/)
- [Python](https://www.python.org//)
- [Docker](https://www.docker.com)
or
- [Docker compose](https://docs.docker.com/compose)
or
- [Python](https://www.python.org)

### Installation

1. Get into EOEPCA's development environment

```sh
vagrant ssh
```

3. Clone the repo
1. Clone the repo

```sh
git clone https://github.com/EOEPCA/um-identity-api
```

4. Change local directory
2. Change local directory

```sh
cd um-identity-api
```

5. Execute
3. Execute

5.1 Run locally with Python
3.1 Run with docker compose
```sh
docker compose up -d --build
```
3.2 Run with Python
```sh
pip install -r requirements.txt
python -m "flask" run --host=0.0.0.0 --port=5566
uvicorn app.main:app
```
5.2 Run locally with Docker
3.3 Run with Docker
```sh
docker build . --progress=plain -t um-identity-api:develop
docker run --rm -dp 5566:5566 --name um-identity-api um-identity-api:develop
docker build . --progress=plain -t um-identity-api:local
docker run --rm -dp 8080:8080 --name um-identity-api um-identity-api:local
```
5.3 Run develop branch with Docker
3.4 Run develop branch with Docker
```sh
docker run --rm -dp 5566:5566 --name um-identity-api ghcr.io/eoepca/um-identity-api:develop
docker run --rm -dp 8080:8080 --name um-identity-api ghcr.io/eoepca/um-identity-api:develop
```
5.4 Run master branch with Docker
3.5 Run master branch with Docker
```sh
docker run --rm -dp 5566:5566 --name um-identity-api ghcr.io/eoepca/um-identity-api:production
docker run --rm -dp 8080:8080 --name um-identity-api ghcr.io/eoepca/um-identity-api:production
```

## Documentation

The component documentation can be found at https://eoepca.github.io/um-identity-api/.

<!-- USAGE EXAMPLES -->

## Usage

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

_For more examples, please refer to the [Documentation](https://example.com)_

<!-- ROADMAP -->
Check Redoc page to try out the API, available at http://localhost:8080/redoc

## Roadmap

See the [open issues](https://github.com/EOEPCA/um-identity-api/issues) for a list of proposed features (and known issues).

<!-- CONTRIBUTING -->
See the [open issues](https://github.com/EOEPCA/um-identity-api/issues) for a list of proposed features (and known
issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any
contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

<!-- LICENSE -->

## License

Expand All @@ -169,17 +141,27 @@ Project Link: [https://github.com/EOEPCA/um-identity-api](https://github.com/EOE

## Acknowledgements

- README.md is based on [this template](https://github.com/othneildrew/Best-README-Template) by [Othneil Drew](https://github.com/othneildrew).
- README.md is based on [this template](https://github.com/othneildrew/Best-README-Template)
by [Othneil Drew](https://github.com/othneildrew).

[contributors-shield]: https://img.shields.io/github/contributors/EOEPCA/um-identity-api.svg?style=flat-square

[contributors-shield]: https://img.shields.io/github/contributors/EOEPCA/um-identity-apisvg?style=flat-square
[contributors-url]: https://github.com/EOEPCA/um-identity-api/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/EOEPCA/um-identity-apisvg?style=flat-square

[forks-shield]: https://img.shields.io/github/forks/EOEPCA/um-identity-api.svg?style=flat-square

[forks-url]: https://github.com/EOEPCA/um-identity-api/network/members
[stars-shield]: https://img.shields.io/github/stars/EOEPCA/um-identity-apisvg?style=flat-square

[stars-shield]: https://img.shields.io/github/stars/EOEPCA/um-identity-api.svg?style=flat-square

[stars-url]: https://github.com/EOEPCA/um-identity-api/stargazers
[issues-shield]: https://img.shields.io/github/issues/EOEPCA/um-identity-apisvg?style=flat-square

[issues-shield]: https://img.shields.io/github/issues/EOEPCA/um-identity-api.svg?style=flat-square

[issues-url]: https://github.com/EOEPCA/um-identity-api/issues
[license-shield]: https://img.shields.io/github/license/EOEPCA/um-identity-apisvg?style=flat-square

[license-shield]: https://img.shields.io/github/license/EOEPCA/um-identity-api.svg?style=flat-square

[license-url]: https://github.com/EOEPCA/um-identity-api/blob/master/LICENSE
[build-shield]: https://www.travis-ci.com/EOEPCA/um-identity-apisvg?branch=master

[build-shield]: https://www.travis-ci.com/EOEPCA/um-identity-api.svg?branch=master
Empty file added app/__init __.py
Empty file.
8 changes: 8 additions & 0 deletions app/configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import os
from typing import Mapping

from identityutils.configuration import load_configuration

config: Mapping[str, str] = (
load_configuration(os.path.join(os.path.dirname(__file__), "../config.ini"))
)
Loading