Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1758

Kerberos should consider not exporting GSS flags at root level

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Trivial - P5 Trivial - P5
    • None
    • Affects Version/s: None
    • Component/s: kerberos
    • Labels:
      None

      From the ticket:

      All flags in the kerberos package are exported at the root level namespace

      // GSS Flags
      const GSS_C_DELEG_FLAG = 1;
      const GSS_C_MUTUAL_FLAG = 2;
      const GSS_C_REPLAY_FLAG = 4;
      const GSS_C_SEQUENCE_FLAG = 8;
      const GSS_C_CONF_FLAG = 16;
      const GSS_C_INTEG_FLAG = 32;
      const GSS_C_ANON_FLAG = 64;
      const GSS_C_PROT_READY_FLAG = 128;
      const GSS_C_TRANS_FLAG = 256;

      // GSS_OID
      const GSS_C_NO_OID = 0;
      const GSS_MECH_OID_KRB5 = 9;
      const GSS_MECH_OID_SPNEGO = 6;
      This pollutes the root level namespace with a lot of values that are not relevant to the user unless they are using the functions that require these flags.

      I would suggest exporting these values as two additional namespaces

      export const GssFlags =

      Unknown macro: { GSS_C_DELEG_FLAG}

      ;

      export const GssOidFlags =

      Unknown macro: { GSS_C_NO_OID}

      ;
      This will not only free up the kerberos namespace of a lot of values, but will allow for clearer documentation and for checking that the functions are not used with the wrong arguments. I am currently writing the TypeScript type definition file for this package, and the current implementation unfortunately doesn't allow me to type check these flags.

      I understand this is a breaking change, but these values could be added alongside the current declared ones instead as a compromise.

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: