fix command add contract oidc

This commit is contained in:
Cayo Puigdefabregas 2023-09-21 13:19:30 +02:00
parent 5069c793cf
commit 8a7a9476fe
1 changed files with 14 additions and 15 deletions

View File

@ -25,32 +25,31 @@ class AddContractOidc:
@click.argument('client_uri') @click.argument('client_uri')
@click.argument('scope', required=False, default="openid profile rols") @click.argument('scope', required=False, default="openid profile rols")
@click.argument('redirect_uris', required=False) @click.argument('redirect_uris', required=False)
@click.argument('grant_types', required=False, default="authorization_code") @click.argument('grant_types', required=False, default=["authorization_code"])
@click.argument('response_types', required=False, default="code") @click.argument('response_types', required=False, default=["code"])
@click.argument('token_endpoint_auth_method', required=False, default="client_secret_basic") @click.argument('token_endpoint_auth_method', required=False, default="client_secret_basic")
def run( def run(
self, self,
email, email,
client_name, client_name,
client_uri, client_uri,
scope, scope,
redirect_uris, redirect_uris,
grant_types, grant_types,
response_types, response_types,
token_endpoint_auth_method): token_endpoint_auth_method):
self.email = email, self.email = email
self.client_name = client_name, self.client_name = client_name
self.client_uri = client_uri, self.client_uri = client_uri
self.scope = scope, self.scope = scope
self.redirect_uris = redirect_uris, self.redirect_uris = redirect_uris
self.grant_types = grant_types, self.grant_types = grant_types
self.response_types = response_types, self.response_types = response_types
self.token_endpoint_auth_method = token_endpoint_auth_method self.token_endpoint_auth_method = token_endpoint_auth_method
if not self.redirect_uris: if not self.redirect_uris:
self.redirect_uris = "{}/allow_code".format(client_uri) self.redirect_uris = ["{}/allow_code".format(client_uri)]
self.member = MemberFederated.query.filter_by(domain=client_uri).first() self.member = MemberFederated.query.filter_by(domain=client_uri).first()
self.user = User.query.filter_by(email=email).one() self.user = User.query.filter_by(email=email).one()