hunk.code_window:       -- TODO: support ES256, ES384, ES512, PS256, PS384
         _       -> invalidJwk ("Key type: " <> T.unpack keyType <> " is not supported")
       where
         parseHmacKey key size ktype = do
           let secret = BL.fromStrict $ TE.encodeUtf8 key
           when (BL.length secret < size `div` 8) $
             invalidJwk "Key size too small"
  
hunk.labels: keep keep keep replace keep keep keep
hunk.after_edit:       parseHmacKey key size ktype cns = do
  
hunk.file_path: server/src-lib/Hasura/Server/Auth/JWT.hs
hunk.type: replace
file: /* eslint no-unused-vars: 0 */
  /* eslint import/prefer-default-export: 0 */
  import { testMode } from '../../../helpers/common';
  import { setMetaData } from '../../validators/validators';
  
  import {
    checkCreateTableRoute,
    failCTWithoutColumns,
    failCTWithoutPK,
    failCTDuplicateColumns,
    failCTWrongDefaultValue,
    failCTDuplicatePrimaryKey,
    passCT,
    failCTDuplicateTable,
    failAddExistingTable,
    passAddExistingTable,
    deleteCTTestTable,
  } from './spec';
  
  const setup = () => {
    describe('Setup route', () => {
      it('Visit the index route', () => {
        // Visit the index route
        cy.visit('/data/schema/public');
        cy.wait(7000);
        // Get and set validation metadata
        setMetaData();
      });
    });
  };
  
  export const runCreateTableTests = () => {
    describe('Create Table', () => {
      it('Create table button opens the correct route', checkCreateTableRoute);
      it('Fails to create table without columns', failCTWithoutColumns);
      it('Fails to create table without primary key', failCTWithoutPK);
      it('Fails to create with duplicate columns', failCTDuplicateColumns);
      it('Fails to create with duplicate primary key', failCTDuplicatePrimaryKey);
      it('Fails to create with wrong default value', failCTWrongDefaultValue);
      it('Successfuly creates table', passCT);
      it('Fails to add existing table', failAddExistingTable);
      it('Passes add existing table', passAddExistingTable);
      it('Fails to create duplicate table', failCTDuplicateTable);
      it('Delete off the test table', deleteCTTestTable);
    });
  };
  
  if (testMode !== 'cli') {
    setup();
    runCreateTableTests();
  }
  