Strongbox: Convert the strongbox configuration files from XML to YAML format

Created on 28 Dec 2018  ·  7Comments  ·  Source: strongbox/strongbox

Task Description

We would like to convert our configuration files from XML into YAML.

  • [x] Re-work the XmlFileManager into YamlFileManager, so that we could start converting the XML files into YAML. The property names will have to be changed and they'll have to be camel case instead of using hyphens.
  • [x] etc/conf/strongbox.xml
  • [x] etc/conf/strongbox-authorization.xml
  • [x] etc/conf/strongbox-cron-tasks.xml
  • [x] etc/conf/strongbox-security-users.xml

Task Relationships

This task's follow-up tasks: #1216 , #1167, #1169.

Help

  • Our chat
  • Points of contact:

    • @carlspring

    • @sbespalov

    • @fuss86

enhancement good first issue help wanted in progress

Most helpful comment

I think it should be just GET without /xml or /yaml. Content
negotiation should work out of the box in Spring depending on Accept
header.

сб, 2 февр. 2019 г. в 18:59, Pablo Tirado notifications@github.com:

Hi @sbespalov https://github.com/sbespalov @steve-todorov
https://github.com/steve-todorov, I have a question, what do I do about
any controller methods related with this? For example:

@ApiOperation(value = "Retrieves the strongbox-authorization.xml configuration file.")
@ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIG),
                        @ApiResponse(code = 500, message = FAILED_GET_CONFIG) })
@GetMapping(value = "/xml",
            produces = { MediaType.APPLICATION_XML_VALUE,
                         MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity getAuthorizationConfig(@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader)
{
    return processConfig(null, acceptHeader);
}

Do I need to convert it to this?

@ApiOperation(value = "Retrieves the strongbox-authorization.yaml configuration file.")
@ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIG),
                        @ApiResponse(code = 500, message = FAILED_GET_CONFIG) })
@GetMapping(value = "/yaml",
            produces = { "application/x-yaml",
                         MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity getAuthorizationConfig(@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader)
{
    return processConfig(null, acceptHeader);
}


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/strongbox/strongbox/issues/965#issuecomment-459959513,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVunQ0z9nVNfN4Oq7wkZgaq7YifVJTbAks5vJX2sgaJpZM4ZjcP4
.

All 7 comments

Hi @sbespalov @steve-todorov, I have a question, what do I do about any controller methods related with this? For example:

    @ApiOperation(value = "Retrieves the strongbox-authorization.xml configuration file.")
    @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIG),
                            @ApiResponse(code = 500, message = FAILED_GET_CONFIG) })
    @GetMapping(value = "/xml",
                produces = { MediaType.APPLICATION_XML_VALUE,
                             MediaType.APPLICATION_JSON_VALUE })
    public ResponseEntity getAuthorizationConfig(@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader)
    {
        return processConfig(null, acceptHeader);
    }

Do I need to convert it to this?

    @ApiOperation(value = "Retrieves the strongbox-authorization.yaml configuration file.")
    @ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIG),
                            @ApiResponse(code = 500, message = FAILED_GET_CONFIG) })
    @GetMapping(value = "/yaml",
                produces = { "application/x-yaml",
                             MediaType.APPLICATION_JSON_VALUE })
    public ResponseEntity getAuthorizationConfig(@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader)
    {
        return processConfig(null, acceptHeader);
    }

I think it should be just GET without /xml or /yaml. Content
negotiation should work out of the box in Spring depending on Accept
header.

сб, 2 февр. 2019 г. в 18:59, Pablo Tirado notifications@github.com:

Hi @sbespalov https://github.com/sbespalov @steve-todorov
https://github.com/steve-todorov, I have a question, what do I do about
any controller methods related with this? For example:

@ApiOperation(value = "Retrieves the strongbox-authorization.xml configuration file.")
@ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIG),
                        @ApiResponse(code = 500, message = FAILED_GET_CONFIG) })
@GetMapping(value = "/xml",
            produces = { MediaType.APPLICATION_XML_VALUE,
                         MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity getAuthorizationConfig(@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader)
{
    return processConfig(null, acceptHeader);
}

Do I need to convert it to this?

@ApiOperation(value = "Retrieves the strongbox-authorization.yaml configuration file.")
@ApiResponses(value = { @ApiResponse(code = 200, message = SUCCESSFUL_GET_CONFIG),
                        @ApiResponse(code = 500, message = FAILED_GET_CONFIG) })
@GetMapping(value = "/yaml",
            produces = { "application/x-yaml",
                         MediaType.APPLICATION_JSON_VALUE })
public ResponseEntity getAuthorizationConfig(@RequestHeader(HttpHeaders.ACCEPT) String acceptHeader)
{
    return processConfig(null, acceptHeader);
}


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/strongbox/strongbox/issues/965#issuecomment-459959513,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVunQ0z9nVNfN4Oq7wkZgaq7YifVJTbAks5vJX2sgaJpZM4ZjcP4
.

I agree with @sbespalov :+1: :)

I also agree with @sbespalov and @steve-todorov.

@ptirador / @fuss86 ,

Could you guys please also look into updating our documentation?
Thanks! :)

Could you guys please also look into updating our documentation?
Thanks! :)

https://github.com/strongbox/strongbox-docs/pull/10

@ptirador feel free to update it.

@carlspring this part of doc depends on:

  • pre-defined set of roles and privileges:

    • we need to list and explain them in the docs (it's missing now, is that correct ?)

  • security-users (I think @sbespalov knows best how it currently works, honestly)
  • cron-tasks (this will probably be reworked somehow, see SB-540)

Just saw your comments, @fuss86! strongbox/strongbox-docs#10 looks like it's shaping up quite well, thanks!

Was this page helpful?
0 / 5 - 0 ratings