Skip to content

Commit

Permalink
Release (#35)
Browse files Browse the repository at this point in the history
* Fix develop dockerfile

* Change keycloak urls

* Fix develop workflow tag

* Fix production workflow

* Change log message

* Change config

* Add health check

* Fix health check

* Add ready health endpoint

* Fix issue

* Change workflow filenames

* Eoepca 910 um keycloak develop an identity api based on keycloak api (#17)

* feat: policies endpoints added, not completely

* feat: working on update policies

* feat: all remaining added, still policy update not working, create and update scope based permission not working

* feat: last resource permissions endpoints added and working

* fix: changed pyyaml version from 5.4.1 to 5.3.1

* feat: endpoints changed

* Update README

* Update config

* Update config

* Update config

* Api testing (#18)

* feat: added client_id as param to enpoints and other fixes

* added changes for permissions endpoints

* Update ci

* Update ci

* Release v1.0.0

* Fix ci

* Fix requirements

* Fix ci

* Upgrade flask version

* Update requirements

* feat: added error handling (#23)

* feat: added validator of register and protect resource enpoint to test

* feat: register and protect resources endpoint working

* feat: added delete resources, policies and permissions

* Update ci

* Update ci

* Fix ci

* Add options method to endpoints

* feat: added endpoint to create client, add resources and protect them if provided

* Revert "Add options method to endpoints"

This reverts commit 9d8c034.

* fea: commit fixes

* feat: more fixes, some endpoint were dounbled

* fix: last fix

* Update ci

* fix: policies fix, response now return client id and resources created

* feat: create client default to confidential and authorization enabled

* Convert to FastAPI

* Convert to FastAPI

* changes to models

* Remove file

* Add error handling, pydantic models, files restructuring

* Fix issues

* Handle keycloak error message

* added fildes to models and descriptions

* Add authenticated field

* Clean and reformat

* Point to keycloak client 1.0.0

* Change logging

* Fix readme

* Clean

* Change logging

* Clean

* merge to develop

* added default resource to response list

* Create default resource

* Fix policies issue

* Improvements

* Change keycloak client to v1.0.0

* Clarify readme

* Add log file

* Fix gitignore

* Fix dockerfile

* Change logging

* Change settings to pydantic

* Clean and reformat

* Update to keycloak client 1.0.1

* Remove log file

* Update gitignore

* Change default scope

* Fix bugs

* Bump client version

* Fix update resources

---------

Co-authored-by: flaviorosadme <[email protected]>
Co-authored-by: flaviorosadme <[email protected]>
  • Loading branch information
3 people authored Dec 18, 2023
1 parent 4ef4689 commit 8d91ca5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 9 additions & 1 deletion app/models/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ class Resource(APIBaseModel):
ownerManagedAccess: Optional[bool] = Field(False, description="Enable/Disable management by the resource owner")
permissions: Optional[ResourcePermission] = Field(None, description="Resource permissions")
decisionStrategy: Optional[DecisionStrategy] = Field(DecisionStrategy.UNANIMOUS.value,
description="Decision strategy to decide how to apply permissions")
description="Decision strategy to decide how to apply permissions")

class UpdateResource(APIBaseModel):
name: Optional[str] = Field(description="Resource name")
uris: Optional[List[str]] = Field(description="Resource URIs")
attributes: Optional[Any] = Field(description="Resource attributes")
scopes: Optional[List[str]] = Field(description="Resource scopes")
ownerManagedAccess: Optional[bool] = Field(description="Enable/Disable management by the resource owner")
displayName: Optional[str] = Field(description="Resource display description")
7 changes: 3 additions & 4 deletions app/routers/clients_resources.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from typing import List

from fastapi import APIRouter, HTTPException
from fastapi import APIRouter

from app.keycloak_client import keycloak
from app.log import logger
from app.models.policies import PolicyType
from app.models.resources import Resource
from app.models.resources import Resource, UpdateResource
from app.routers.resources import get_resources

router = APIRouter(
Expand Down Expand Up @@ -109,7 +108,7 @@ def delete_resource_and_policies(client_id: str, resource_name: str):


@router.put("/{resource_id}")
def update_resource(client_id: str, resource_id: str, resource: Resource):
def update_resource(client_id: str, resource_id: str, resource: UpdateResource):
return keycloak.update_resource(client_id, resource_id, resource.model_dump())


Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ services:
build:
context: .
dockerfile: Dockerfile
image: um-identity-api:local
container_name: um-identity-api
environment:
- AUTH_SERVER_URL=http://keycloak:8080
Expand Down

0 comments on commit 8d91ca5

Please sign in to comment.