hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
152 stars 83 forks source link

Access Control #41

Closed jrburk closed 2 years ago

jrburk commented 6 years ago

I want to enable HAP for an existing smart home gateway. The gateway has access control with different permissions configurable for individual users.

Using this library I don't I don't have the information who performed and action:

public CompletableFuture setSwitchState(boolean powerState) throws Exception

Can the current user (or even a session) be passed to that call. As an alternative it could been made available using a java.lang.ThreadLocal (which is a temporay hack until we have a proper solution).

andylintner commented 6 years ago

There’s no concept of a “User” in HomeKit, so there’s nothing to pass.

jrburk commented 6 years ago

But the API has com.beowulfe.hap.HomekitAuthInfo to do the pairing. I assume the communication is encrypted using the keys stored by this interface.

It would be helpful to have that IOS user been passed or made available to the methods mentioned above.

andylintner commented 6 years ago

There’s no ID for the user beyond the key. And only a single pairing can exist for a given HomeKit device, so there’s no multiuser.

alexmuntean commented 5 years ago

thanks @beowulfe . I didn't know there's no multipairing.. I was looking for that... I got it working with other users too (sharing in home app)

yfre commented 2 years ago

closing as users management is not supported by homekit