Re: NSCredential credentialWithIdentity:certificates:persistence:
Ronald Oussoren via Pyobjc-dev <[email protected]> Sat, 25 Jul 2020 17:21:43 +0200
| Newsgroups | gmane.comp.python.pyobjc.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============6133746361095568512== Content-Type: multipart/alternative; boundary="Apple-Mail=_4BAFC404-6C17-40BC-B2B4-51575F70E4FD" --Apple-Mail=_4BAFC404-6C17-40BC-B2B4-51575F70E4FD Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 25 Jul 2020, at 12:16, Eric Falconnier <[email protected]> wrote: >=20 > Hi, >=20 > I am trying to use the following class method: >=20 > NSCredential credentialWithIdentity:certificates:persistence: > = https://developer.apple.com/documentation/foundation/nsurlcredential/14281= 92-credentialwithidentity >=20 > (Python3.6 in a virtualenv on macos 10.15 with PyObjc v6.2.2) >=20 > Metadata: >=20 > {'arguments': ({'_template': True, 'type': b'@'}, > {'_template': True, 'type': b':'}, > {'null_accepted': True, 'type': b'^{__SecIdentity=3D}'}, > {'_template': True, 'type': b'@'}, > {'_template': True, 'type': b'Q'}), > 'classmethod': True, > 'hidden': False, > 'retval': {'_template': True, 'type': b'@'}} >=20 > I get a SecIdentity object from a previous SecItemCopyMatching call. >=20 > When I pass it to this method, i get the following error: >=20 > depythonifying 'pointer', got 'SecIdentityRef' >=20 > How could I fix this issue? Do I need to pass the SecIdentity as a = different kind of argument? Is it possible to change the metadata with = registerMetaDataForSelector ? I need to look into this, I seem to have missed something when creating = the bindings. The security bindings are currently created by hand, my = tooling for generating the metadata has problems with processing the = security headers. What should work as a workaround: use registerMetaDataFor to change the = type for argument 2 to =E2=80=9C@=E2=80=9C. Ronald =E2=80=94 Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ = <https://blog.ronaldoussoren.net/> >=20 > Thanks, >=20 > -- > =C3=89ric >=20 >=20 >=20 > _______________________________________________ > Pyobjc-dev mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev --Apple-Mail=_4BAFC404-6C17-40BC-B2B4-51575F70E4FD Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div = class=3D""><br class=3D""> </div> <div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On 25 Jul 2020, at 12:16, Eric Falconnier <<a = href=3D"mailto:[email protected]" class=3D"">[email protected]</a>> = wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div = class=3D"">Hi,<br class=3D""><br class=3D"">I am trying to use the = following class method:<br class=3D""><br class=3D"">NSCredential = credentialWithIdentity:certificates:persistence:<br class=3D""><a = href=3D"https://developer.apple.com/documentation/foundation/nsurlcredenti= al/1428192-credentialwithidentity" = class=3D"">https://developer.apple.com/documentation/foundation/nsurlcrede= ntial/1428192-credentialwithidentity</a><br class=3D""><br = class=3D"">(Python3.6 in a virtualenv on macos 10.15 with PyObjc = v6.2.2)<br class=3D""><br class=3D"">Metadata:<br class=3D""><br = class=3D"">{'arguments': ({'_template': True, 'type': b'@'},<br = class=3D""> = &n= bsp; {'_template': True, 'type': b':'},<br class=3D""> = &n= bsp; {'null_accepted': True, 'type': b'^{__SecIdentity=3D}'},<br = class=3D""> = &n= bsp; {'_template': True, 'type': b'@'},<br class=3D""> = &n= bsp; {'_template': True, 'type': b'Q'}),<br class=3D""> = 'classmethod': True,<br class=3D""> 'hidden': False,<br class=3D""> = 'retval': {'_template': True, 'type': b'@'}}<br class=3D""><br = class=3D"">I get a SecIdentity object from a previous = SecItemCopyMatching call.<br class=3D""><br class=3D"">When I pass it to = this method, i get the following error:<br class=3D""><br = class=3D"">depythonifying 'pointer', got 'SecIdentityRef'<br = class=3D""><br class=3D"">How could I fix this issue? Do I need to pass = the SecIdentity as a different kind of argument? Is it possible to = change the metadata with registerMetaDataForSelector ?<br = class=3D""></div></div></blockquote><div><br class=3D""></div><div>I = need to look into this, I seem to have missed something when creating = the bindings. The security bindings are currently created by hand, my = tooling for generating the metadata has problems with processing the = security headers.</div><div><br class=3D""></div><div>What should work = as a workaround: use registerMetaDataFor to change the type for argument = 2 to =E2=80=9C@=E2=80=9C.</div><div><br = class=3D""></div><div>Ronald</div><div>=E2=80=94</div><div><br = class=3D""></div><div>Twitter / micro.blog: = @ronaldoussoren</div><div>Blog: <a = href=3D"https://blog.ronaldoussoren.net/" = class=3D"">https://blog.ronaldoussoren.net/</a></div><div><br = class=3D""></div><div><br class=3D""></div><blockquote type=3D"cite" = class=3D""><div class=3D""><div class=3D""><br class=3D"">Thanks,<br = class=3D""><br class=3D"">--<br class=3D"">=C3=89ric<br class=3D""><br = class=3D""><br class=3D""><br = class=3D"">_______________________________________________<br = class=3D"">Pyobjc-dev mailing list<br class=3D""><a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a><br = class=3D"">https://lists.sourceforge.net/lists/listinfo/pyobjc-dev<br = class=3D""></div></div></blockquote></div><br class=3D""></body></html>= --Apple-Mail=_4BAFC404-6C17-40BC-B2B4-51575F70E4FD-- --===============6133746361095568512== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6133746361095568512== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Pyobjc-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyobjc-dev --===============6133746361095568512==--