Skip to content

Commit

Permalink
feat: add all missing APIs (#65)
Browse files Browse the repository at this point in the history
* feat: add all missing APIs

* feat: add all missing APIs

* feat: add all missing APIs
  • Loading branch information
palp1tate authored Sep 3, 2023
1 parent 6075a0f commit 542c8d9
Show file tree
Hide file tree
Showing 24 changed files with 2,129 additions and 64 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from setuptools import setup

setup()
36 changes: 36 additions & 0 deletions src/casdoor/adapter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2021 The Casbin Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


class Adapter:
def __init__(self):
self.owner = "string"
self.name = "string"
self.createdTime = "string"
self.type = "string"
self.databaseType = "string"
self.host = "string"
self.port = 0
self.user = "string"
self.password = "string"
self.database = "string"
self.table = "string"
self.tableNamePrefix = "string"
self.isEnabled = True

def __str__(self):
return str(self.__dict__)

def to_dict(self) -> dict:
return self.__dict__
98 changes: 98 additions & 0 deletions src/casdoor/application.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 2021 The Casbin Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .organization import Organization, ThemeData
from .provider import Provider


class ProviderItem:
def __init__(self):
self.owner = "string"
self.name = "string"
self.canSignUp = True
self.canSignIn = True
self.canUnlink = True
self.prompted = True
self.alertType = "string"
self.rule = "string"
self.provider = Provider

def __str__(self):
return str(self.__dict__)

def to_dict(self) -> dict:
return self.__dict__


class SignupItem:
def __init__(self):
self.name = "string"
self.visible = True
self.required = True
self.prompted = True
self.rule = "string"

def __str__(self):
return str(self.__dict__)

def to_dict(self) -> dict:
return self.__dict__


class Application:
def __init__(self):
self.owner = "string"
self.name = "string"
self.createdTime = "string"
self.displayName = "string"
self.logo = "string"
self.homepageUrl = "string"
self.description = "string"
self.organization = "string"
self.cert = "string"
self.enablePassword = True
self.enableSignUp = True
self.enableSigninSession = True
self.enableAutoSignin = True
self.enableCodeSignin = True
self.enableSamlCompress = True
self.enableWebAuthn = True
self.enableLinkWithEmail = True
self.orgChoiceMode = "string"
self.samlReplyUrl = "string"
self.providers = [ProviderItem]
self.signupItems = [SignupItem]
self.grantTypes = ["string"]
self.organizationObj = Organization
self.tags = ["string"]
self.clientId = "string"
self.clientSecret = "string"
self.redirectUris = ["string"]
self.tokenFormat = "string"
self.expireInHours = 0
self.refreshExpireInHours = 0
self.signupUrl = "string"
self.signinUrl = "string"
self.forgetUrl = "string"
self.affiliationUrl = "string"
self.termsOfUse = "string"
self.signupHtml = "string"
self.signinHtml = "string"
self.themeData = ThemeData

def __str__(self):
return str(self.__dict__)

def to_dict(self) -> dict:
return self.__dict__
36 changes: 36 additions & 0 deletions src/casdoor/cert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2021 The Casbin Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


class Cert:
def __init__(self):
self.name = "string"
self.owner = "string"
self.createdTime = "string"
self.displayName = "string"
self.type = "string"
self.scope = "string"
self.cryptoAlgorithm = "string"
self.bitSize = 0
self.expireInYears = 0
self.certificate = "string"
self.privateKey = "string"
self.authorityPublicKey = "string"
self.authorityRootPublicKey = "string"

def __str__(self):
return str(self.__dict__)

def to_dict(self) -> dict:
return self.__dict__
32 changes: 32 additions & 0 deletions src/casdoor/enforcer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2021 The Casbin Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


class Enforcer:
def __init__(self):
self.owner = "string"
self.name = "string"
self.createdTime = "string"
self.updatedTime = "string"
self.displayName = "string"
self.description = "string"
self.model = "string"
self.adapter = "string"
self.isEnabled = True

def __str__(self):
return str(self.__dict__)

def to_dict(self) -> dict:
return self.__dict__
40 changes: 40 additions & 0 deletions src/casdoor/group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2021 The Casbin Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from .user import User


class Group:
def __init__(self):
self.owner = "string"
self.name = "string"
self.createdTime = "string"
self.updatedTime = "string"
self.displayName = "string"
self.manager = "string"
self.contactEmail = "string"
self.type = "string"
self.parentId = "string"
self.isTopGroup = True
self.users = [User]
self.title = "string"
self.key = "string"
self.children = [Group]
self.isEnabled = True

def __str__(self):
return str(self.__dict__)

def to_dict(self) -> dict:
return self.__dict__
Loading

0 comments on commit 542c8d9

Please sign in to comment.