API: remove confKey from PUT body

Moo
Maxime Besson 5 years ago
parent 338958f269
commit ac3d521c5e
  1. 133
      doc/pages/manager-api/index.html
  2. 63
      doc/sources/manager-api/openapi-spec.yaml
  3. 7
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Providers/CasApp.pm
  4. 7
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Api/Providers/OidcRp.pm

@ -714,6 +714,28 @@
"$ref" : "#/components/schemas/casOptions"
}
}
};
defs.CasAppReplace = {
"type" : "object",
"properties" : {
"macros" : {
"type" : "object",
"example" : {
"myMacroName" : "$macro(rule)"
}
},
"exportedVars" : {
"type" : "object",
"default" : {
"cn" : "cn",
"mail" : "mail",
"uid" : "uid"
}
},
"options" : {
"$ref" : "#/components/schemas/casOptions"
}
}
};
defs.CasAppUpdate = {
"type" : "object",
@ -976,6 +998,38 @@
"$ref" : "#/components/schemas/OidcOptions"
}
}
};
defs.OidcRpReplace = {
"required" : [ "clientId", "redirectUris" ],
"type" : "object",
"properties" : {
"clientId" : {
"type" : "string"
},
"exportedVars" : {
"type" : "object",
"example" : {
"email" : "mail",
"family_name" : "sn",
"name" : "cn"
}
},
"extraClaims" : {
"type" : "object",
"example" : {
"myscope" : "myattr1 myattr2 myattr3"
}
},
"macros" : {
"type" : "object",
"example" : {
"myMacroName" : "$macro(rule)"
}
},
"options" : {
"$ref" : "#/components/schemas/OidcOptions"
}
}
};
defs.OidcRpUpdate = {
"type" : "object",
@ -1111,6 +1165,31 @@
"$ref" : "#/components/schemas/samlOptions"
}
}
};
defs.SamlSpReplace = {
"required" : [ "metadata" ],
"type" : "object",
"properties" : {
"metadata" : {
"type" : "string",
"example" : "<?xml version=\"1.0\"?><EntityDescriptor..."
},
"macros" : {
"type" : "object",
"example" : {
"myMacroName" : "$macro(rule)"
}
},
"exportedAttributes" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/samlAttribute"
}
},
"options" : {
"$ref" : "#/components/schemas/samlOptions"
}
}
};
defs.SamlSpUpdate = {
"type" : "object",
@ -3233,7 +3312,7 @@ public class CasappApiExample {
CasappApi apiInstance = new CasappApi();
confKey confKey = ; // confKey | Configuration key of CAS Application that needs to be replaced
CasApp body = ; // CasApp |
CasAppReplace body = ; // CasAppReplace |
try {
apiInstance.replaceCasApp(confKey, body);
} catch (ApiException e) {
@ -3252,7 +3331,7 @@ public class CasappApiExample {
public static void main(String[] args) {
CasappApi apiInstance = new CasappApi();
confKey confKey = ; // confKey | Configuration key of CAS Application that needs to be replaced
CasApp body = ; // CasApp |
CasAppReplace body = ; // CasAppReplace |
try {
apiInstance.replaceCasApp(confKey, body);
} catch (ApiException e) {
@ -3268,7 +3347,7 @@ public class CasappApiExample {
</div> -->
<div class="tab-pane" id="examples-Casapp-replaceCasApp-0-objc">
<pre class="prettyprint"><code class="language-cpp">confKey *confKey = ; // Configuration key of CAS Application that needs to be replaced
CasApp *body = ; // (optional)
CasAppReplace *body = ; // (optional)
CasappApi *apiInstance = [[CasappApi alloc] init];
@ -3289,7 +3368,7 @@ CasappApi *apiInstance = [[CasappApi alloc] init];
var api = new LemonLdapngManagerApi.CasappApi()
var confKey = ; // {{confKey}} Configuration key of CAS Application that needs to be replaced
var opts = {
'body': // {{CasApp}}
'body': // {{CasAppReplace}}
};
var callback = function(error, data, response) {
if (error) {
@ -3321,7 +3400,7 @@ namespace Example
var apiInstance = new CasappApi();
var confKey = new confKey(); // confKey | Configuration key of CAS Application that needs to be replaced
var body = new CasApp(); // CasApp | (optional)
var body = new CasAppReplace(); // CasAppReplace | (optional)
try
{
@ -3344,7 +3423,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiCasappApi();
$confKey = ; // confKey | Configuration key of CAS Application that needs to be replaced
$body = ; // CasApp |
$body = ; // CasAppReplace |
try {
$api_instance->replaceCasApp($confKey, $body);
@ -3361,7 +3440,7 @@ use WWW::SwaggerClient::CasappApi;
my $api_instance = WWW::SwaggerClient::CasappApi->new();
my $confKey = ; # confKey | Configuration key of CAS Application that needs to be replaced
my $body = WWW::SwaggerClient::Object::CasApp->new(); # CasApp |
my $body = WWW::SwaggerClient::Object::CasAppReplace->new(); # CasAppReplace |
eval {
$api_instance->replaceCasApp(confKey => $confKey, body => $body);
@ -3381,7 +3460,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.CasappApi()
confKey = # confKey | Configuration key of CAS Application that needs to be replaced
body = # CasApp | (optional)
body = # CasAppReplace | (optional)
try:
# Replaces a CAS Application
@ -3440,7 +3519,7 @@ except ApiException as e:
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/CasApp"
"$ref" : "#/components/schemas/CasAppReplace"
}
}
}
@ -13528,7 +13607,7 @@ public class OidcrpApiExample {
OidcrpApi apiInstance = new OidcrpApi();
confKey confKey = ; // confKey | Configuration key of OpenID Connect Relaying Party that needs to be replaced
OidcRp body = ; // OidcRp |
OidcRpReplace body = ; // OidcRpReplace |
try {
apiInstance.replaceOidcRp(confKey, body);
} catch (ApiException e) {
@ -13547,7 +13626,7 @@ public class OidcrpApiExample {
public static void main(String[] args) {
OidcrpApi apiInstance = new OidcrpApi();
confKey confKey = ; // confKey | Configuration key of OpenID Connect Relaying Party that needs to be replaced
OidcRp body = ; // OidcRp |
OidcRpReplace body = ; // OidcRpReplace |
try {
apiInstance.replaceOidcRp(confKey, body);
} catch (ApiException e) {
@ -13563,7 +13642,7 @@ public class OidcrpApiExample {
</div> -->
<div class="tab-pane" id="examples-Oidcrp-replaceOidcRp-0-objc">
<pre class="prettyprint"><code class="language-cpp">confKey *confKey = ; // Configuration key of OpenID Connect Relaying Party that needs to be replaced
OidcRp *body = ; // (optional)
OidcRpReplace *body = ; // (optional)
OidcrpApi *apiInstance = [[OidcrpApi alloc] init];
@ -13584,7 +13663,7 @@ OidcrpApi *apiInstance = [[OidcrpApi alloc] init];
var api = new LemonLdapngManagerApi.OidcrpApi()
var confKey = ; // {{confKey}} Configuration key of OpenID Connect Relaying Party that needs to be replaced
var opts = {
'body': // {{OidcRp}}
'body': // {{OidcRpReplace}}
};
var callback = function(error, data, response) {
if (error) {
@ -13616,7 +13695,7 @@ namespace Example
var apiInstance = new OidcrpApi();
var confKey = new confKey(); // confKey | Configuration key of OpenID Connect Relaying Party that needs to be replaced
var body = new OidcRp(); // OidcRp | (optional)
var body = new OidcRpReplace(); // OidcRpReplace | (optional)
try
{
@ -13639,7 +13718,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiOidcrpApi();
$confKey = ; // confKey | Configuration key of OpenID Connect Relaying Party that needs to be replaced
$body = ; // OidcRp |
$body = ; // OidcRpReplace |
try {
$api_instance->replaceOidcRp($confKey, $body);
@ -13656,7 +13735,7 @@ use WWW::SwaggerClient::OidcrpApi;
my $api_instance = WWW::SwaggerClient::OidcrpApi->new();
my $confKey = ; # confKey | Configuration key of OpenID Connect Relaying Party that needs to be replaced
my $body = WWW::SwaggerClient::Object::OidcRp->new(); # OidcRp |
my $body = WWW::SwaggerClient::Object::OidcRpReplace->new(); # OidcRpReplace |
eval {
$api_instance->replaceOidcRp(confKey => $confKey, body => $body);
@ -13676,7 +13755,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.OidcrpApi()
confKey = # confKey | Configuration key of OpenID Connect Relaying Party that needs to be replaced
body = # OidcRp | (optional)
body = # OidcRpReplace | (optional)
try:
# Replaces an OpenID Connect Relaying Party
@ -13735,7 +13814,7 @@ except ApiException as e:
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/OidcRp"
"$ref" : "#/components/schemas/OidcRpReplace"
}
}
}
@ -16236,7 +16315,7 @@ public class SamlspApiExample {
SamlspApi apiInstance = new SamlspApi();
confKey confKey = ; // confKey | Configuration key of SAML Service Provider that needs to be replaced
SamlSp body = ; // SamlSp |
SamlSpReplace body = ; // SamlSpReplace |
try {
apiInstance.replaceSamlSp(confKey, body);
} catch (ApiException e) {
@ -16255,7 +16334,7 @@ public class SamlspApiExample {
public static void main(String[] args) {
SamlspApi apiInstance = new SamlspApi();
confKey confKey = ; // confKey | Configuration key of SAML Service Provider that needs to be replaced
SamlSp body = ; // SamlSp |
SamlSpReplace body = ; // SamlSpReplace |
try {
apiInstance.replaceSamlSp(confKey, body);
} catch (ApiException e) {
@ -16271,7 +16350,7 @@ public class SamlspApiExample {
</div> -->
<div class="tab-pane" id="examples-Samlsp-replaceSamlSp-0-objc">
<pre class="prettyprint"><code class="language-cpp">confKey *confKey = ; // Configuration key of SAML Service Provider that needs to be replaced
SamlSp *body = ; // (optional)
SamlSpReplace *body = ; // (optional)
SamlspApi *apiInstance = [[SamlspApi alloc] init];
@ -16292,7 +16371,7 @@ SamlspApi *apiInstance = [[SamlspApi alloc] init];
var api = new LemonLdapngManagerApi.SamlspApi()
var confKey = ; // {{confKey}} Configuration key of SAML Service Provider that needs to be replaced
var opts = {
'body': // {{SamlSp}}
'body': // {{SamlSpReplace}}
};
var callback = function(error, data, response) {
if (error) {
@ -16324,7 +16403,7 @@ namespace Example
var apiInstance = new SamlspApi();
var confKey = new confKey(); // confKey | Configuration key of SAML Service Provider that needs to be replaced
var body = new SamlSp(); // SamlSp | (optional)
var body = new SamlSpReplace(); // SamlSpReplace | (optional)
try
{
@ -16347,7 +16426,7 @@ require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiSamlspApi();
$confKey = ; // confKey | Configuration key of SAML Service Provider that needs to be replaced
$body = ; // SamlSp |
$body = ; // SamlSpReplace |
try {
$api_instance->replaceSamlSp($confKey, $body);
@ -16364,7 +16443,7 @@ use WWW::SwaggerClient::SamlspApi;
my $api_instance = WWW::SwaggerClient::SamlspApi->new();
my $confKey = ; # confKey | Configuration key of SAML Service Provider that needs to be replaced
my $body = WWW::SwaggerClient::Object::SamlSp->new(); # SamlSp |
my $body = WWW::SwaggerClient::Object::SamlSpReplace->new(); # SamlSpReplace |
eval {
$api_instance->replaceSamlSp(confKey => $confKey, body => $body);
@ -16384,7 +16463,7 @@ from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.SamlspApi()
confKey = # confKey | Configuration key of SAML Service Provider that needs to be replaced
body = # SamlSp | (optional)
body = # SamlSpReplace | (optional)
try:
# Replaces a SAML Service
@ -16443,7 +16522,7 @@ except ApiException as e:
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/SamlSp"
"$ref" : "#/components/schemas/SamlSpReplace"
}
}
}

@ -135,7 +135,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SamlSp'
$ref: '#/components/schemas/SamlSpReplace'
responses:
204:
$ref: '#/components/responses/NoContent'
@ -327,7 +327,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/OidcRp'
$ref: '#/components/schemas/OidcRpReplace'
responses:
204:
$ref: '#/components/responses/NoContent'
@ -469,7 +469,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/CasApp'
$ref: '#/components/schemas/CasAppReplace'
responses:
204:
$ref: '#/components/responses/NoContent'
@ -1067,6 +1067,24 @@ components:
$ref: '#/components/schemas/samlAttribute'
options:
$ref: '#/components/schemas/samlOptions'
SamlSpReplace:
type: object
required:
- metadata
properties:
metadata:
type: string
example: '<?xml version="1.0"?><EntityDescriptor...'
macros:
type: object
example:
myMacroName: "$macro(rule)"
exportedAttributes:
type: object
items:
$ref: '#/components/schemas/samlAttribute'
options:
$ref: '#/components/schemas/samlOptions'
samlOptions:
type: object
properties:
@ -1257,6 +1275,30 @@ components:
myMacroName: "$macro(rule)"
options:
$ref: '#/components/schemas/OidcOptions'
OidcRpReplace:
type: object
required:
- clientId
- redirectUris
properties:
clientId:
type: string
exportedVars:
type: object
example:
email: mail
family_name: sn
name: cn
extraClaims:
type: object
example:
myscope: "myattr1 myattr2 myattr3"
macros:
type: object
example:
myMacroName: "$macro(rule)"
options:
$ref: '#/components/schemas/OidcOptions'
CasApp:
required:
@ -1292,6 +1334,21 @@ components:
uid: uid
options:
$ref: '#/components/schemas/casOptions'
CasAppReplace:
type: object
properties:
macros:
type: object
example:
myMacroName: "$macro(rule)"
exportedVars:
type: object
default:
cn: cn
mail: mail
uid: uid
options:
$ref: '#/components/schemas/casOptions'
casOptions:
required:
- service

@ -195,13 +195,6 @@ sub replaceCasApp {
return $self->sendError( $req, "Invalid input: " . $req->error, 400 )
unless ($replace);
return $self->sendError( $req, 'Invalid input: confKey is missing', 400 )
unless ( defined $replace->{confKey} );
return $self->sendError( $req, 'Invalid input: confKey is not a string',
400 )
if ( ref $replace->{confKey} );
$self->logger->debug(
"[API] CAS App $confKey configuration replace requested");

@ -204,13 +204,6 @@ sub replaceOidcRp {
return $self->sendError( $req, "Invalid input: " . $req->error, 400 )
unless ($replace);
return $self->sendError( $req, 'Invalid input: confKey is missing', 400 )
unless ( defined $replace->{confKey} );
return $self->sendError( $req, 'Invalid input: confKey is not a string',
400 )
if ( ref $replace->{confKey} );
return $self->sendError( $req, 'Invalid input: clientId is missing', 400 )
unless ( defined $replace->{clientId} );

Loading…
Cancel
Save