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

Passkey access groups #11667

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class AuthenticatorAssertionResponse : public AuthenticatorResponse {
bool synchronizable() const { return m_synchronizable; }
LAContext * laContext() const { return m_laContext.get(); }
RefPtr<ArrayBuffer> largeBlob() const { return m_largeBlob; }
const String& accessGroup() const { return m_accessGroup; }

WEBCORE_EXPORT void setAuthenticatorData(Vector<uint8_t>&&);
void setSignature(Ref<ArrayBuffer>&& signature) { m_signature = WTFMove(signature); }
Expand All @@ -63,6 +64,7 @@ class AuthenticatorAssertionResponse : public AuthenticatorResponse {
void setSynchronizable(bool synchronizable) { m_synchronizable = synchronizable; }
void setLAContext(LAContext *context) { m_laContext = context; }
void setLargeBlob(Ref<ArrayBuffer>&& largeBlob) { m_largeBlob = WTFMove(largeBlob); }
void setAccessGroup(const String& accessGroup) { m_accessGroup = accessGroup; }

private:
AuthenticatorAssertionResponse(Ref<ArrayBuffer>&&, Ref<ArrayBuffer>&&, Ref<ArrayBuffer>&&, RefPtr<ArrayBuffer>&&, AuthenticatorAttachment);
Expand All @@ -83,6 +85,7 @@ class AuthenticatorAssertionResponse : public AuthenticatorResponse {
RetainPtr<SecAccessControlRef> m_accessControl;
RetainPtr<LAContext> m_laContext;
RefPtr<ArrayBuffer> m_largeBlob;
String m_accessGroup;
};

} // namespace WebCore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class WebAuthenticationAssertionResponse final : public ObjectImpl<Object::Type:
bool synchronizable() const { return m_response->synchronizable(); }
const WTF::String& group() const { return m_response->group(); }
RefPtr<Data> credentialID() const;
const WTF::String& accessGroup() const { return m_response->accessGroup(); }

void setLAContext(LAContext *context) { m_response->setLAContext(context); }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ WK_CLASS_AVAILABLE(macos(11.0), ios(14.0))
@property (nonatomic, readonly) BOOL synchronizable;
@property (nonatomic, readonly, copy) NSString *group;
@property (nonatomic, readonly, copy) NSData *credentialID;
@property (nonatomic, readonly, copy) NSString *accessGroup;

- (void)setLAContext:(LAContext *)context WK_API_AVAILABLE(macos(12.0), ios(15.0));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ - (NSData *)credentialID
return wrapper(_response->credentialID());
}

- (NSString *)accessGroup
{
return _response->accessGroup();
}

#endif // ENABLE(WEB_AUTHN)

- (void)setLAContext:(LAContext *)context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ static inline uint8_t authDataFlags(ClientDataType type, LocalConnection::UserVe
if (it != responseMap.end() && it->second.isByteString())
response->setLargeBlob(ArrayBuffer::create(it->second.getByteString()));

response->setAccessGroup(attributes[(id)kSecAttrAccessGroup]);

result.uncheckedAppend(WTFMove(response));
}
return result;
Expand Down