Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List signing services by type #779

Open
quba42 opened this issue Sep 4, 2023 · 6 comments
Open

List signing services by type #779

quba42 opened this issue Sep 4, 2023 · 6 comments
Labels
feature request New feature request (template-set)

Comments

@quba42
Copy link
Contributor

quba42 commented Sep 4, 2023

Summary

When using signing services it is essential to use the correct type of signing service.
Using AsciiArmoredDetachedSigningService where the plugin expects AptReleaseSigningService won't work.

However, the pulp signing-service command does not appear to know a --type option.

Examples

I want to be able to do something like:

pulp signing-service --type AptReleaseSigningService list

To list just the signing services of the specified type.

Challenges

I am not sure how problematic it is that pulp signing-service is a pulpcore associated command, while many signing service types may be plugin specific.

@quba42 quba42 added feature request New feature request (template-set) Triage-Needed Needs to be reviewed at next pulp-cli mtg labels Sep 4, 2023
@mdellweg
Copy link
Member

mdellweg commented Sep 4, 2023

The issue is that signing services are not master-detail like remotes et al.
There is no filter to achieve this either:

$ pulp -p container debug openapi operation --id signing_services_list | jq '.operation.parameters[].name'
"limit"
"name"
"offset"
"ordering"
"pulp_href__in"
"pulp_id__in"
"fields"
"exclude_fields"

and it looks like the pulp_href is the only discriminator today:

pulp -p container debug openapi schema --name SigningServiceResponse
{
  "type": "object",
  "description": "A serializer for the model declaring a signing service.",
  "properties": {
    "pulp_href": {
      "type": "string",
      "format": "uri",
      "readOnly": true
    },
    "pulp_created": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "Timestamp of creation."
    },
    "name": {
      "type": "string",
      "description": "A unique name used to recognize a script."
    },
    "public_key": {
      "type": "string",
      "description": "The value of a public key used for the repository verification."
    },
    "pubkey_fingerprint": {
      "type": "string",
      "description": "The fingerprint of the public key."
    },
    "script": {
      "type": "string",
      "description": "An absolute path to a script which is going to be used for the signing."
    }
  },
  "required": [
    "name",
    "pubkey_fingerprint",
    "public_key",
    "script"
  ]
}

@quba42
Copy link
Contributor Author

quba42 commented Sep 4, 2023

@mdellweg Do you think perhaps it would make sense to explicitly add a "type" field (or similar) to the SigningService base class?

AFAIK you can currently supply signing services of the wrong type to the API, and it will simply try to use it instead of providing a clear error message for that particular user error. Maybe the fact that there are signing services of very different types needs to be made much more explicit in general (not just for Pulp CLI)?

@mdellweg
Copy link
Member

mdellweg commented Sep 4, 2023

I agree. I cannot recall the reasons why we didn't use the master-detail in the first place.
But also i think
https://github.com/pulp/pulp_deb/blob/main/pulp_deb/app/serializers/publication_serializers.py#L42
Should limit to the proper choice.

@ggainey
Copy link
Contributor

ggainey commented Oct 25, 2023

Given the discussion, it seems CLI needs to wait for a pulpcore change to make this possible. Leaving this open for if/when/as such a thing happens.

@quba42
Copy link
Contributor Author

quba42 commented Oct 25, 2023

@mdellweg Do you think we should open a pulpcore issue?

@mdellweg
Copy link
Member

Is this still a thing? At that point, i think a type field in the pulpcore serializer together with an appropriate filter is in order.
Would you create an issue to that end?

@mdellweg mdellweg removed the Triage-Needed Needs to be reviewed at next pulp-cli mtg label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature request (template-set)
Projects
None yet
Development

No branches or pull requests

3 participants