jborean93 / pykrb5

Python krb5 API interface
MIT License
17 stars 8 forks source link

Add get_etype_info() and c_string_to_key() #42

Closed steffen-kiess closed 8 months ago

steffen-kiess commented 8 months ago

This API contains another value (enctype) which could be done as an enum. However enctype values are already used in other places (KeyBlock.enctype, kt_get_entry(), kt_read_service_key(), enctype_to_name() and enctype_to_string(), string_to_enctype()), so I was not sure whether I should create an enum for it.

jborean93 commented 8 months ago

so I was not sure whether I should create an enum for it.

I'm off two minds here, I think we should but as you've said there is already precedence where the etype has not been returned as an enum. I think for now let's just keep it like that and in the future we could change them all to be an IntEnum. That way we can also investigate further whether or not that could break other things but AFAIK using IntEnum is essentially a subtype of int so should be ok.

steffen-kiess commented 8 months ago

I'm off two minds here, I think we should but as you've said there is already precedence where the etype has not been returned as an enum. I think for now let's just keep it like that and in the future we could change them all to be an IntEnum. That way we can also investigate further whether or not that could break other things but AFAIK using IntEnum is essentially a subtype of int so should be ok.

I've left it as an int for now.

I also update the PR to use a named tuple.