<commit_before>/**
 * @license
 * Copyright 2018 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.CLASS({
  package: 'foam.nanos.auth',
  name: 'ServiceProvider',

  implements: ['foam.nanos.auth.EnabledAware'],

  documentation: 'Service Provider',

  tableColumns: ['id', 'description'],

  properties: [
    {
      class: 'String',
      name: 'id',
      documentation: 'Service provider name',
      validationPredicates: [
        {
          args: ['id'],
          predicateFactory: function(e) {
            return e.REG_EXP(foam.nanos.auth.ServiceProvider.ID, /^[a-z0-9]+$/);
          },
          errorString: 'Invalid character(s) in id.'
        }
      ]
    },
    {
      class: 'Boolean',
      name: 'enabled'
    },
    {
      class: 'String',
      name: 'description',
      documentation: 'Service provider description'
    }
  ]
});<commit_msg>make spid extend capability<commit_after>/**
 * @license
 * Copyright 2018 The FOAM Authors. All Rights Reserved.
 * http://www.apache.org/licenses/LICENSE-2.0
 */

foam.SCRIPT({
  package: 'foam.nanos.auth',
  name: 'ServiceProviderFixer',
  code: function () {
    foam.lookup('foam.nanos.crunch.Capability');
  }
});

foam.CLASS({
  package: 'foam.nanos.auth',
  name: 'ServiceProvider',
  extends: 'foam.nanos.crunch.Capability',

  documentation: 'Service Provider Capability',

  properties: [
    {
      class: 'String',
      name: 'id',
      documentation: 'Service provider name',
      validationPredicates: [
        {
          args: ['id'],
          predicateFactory: function(e) {
            return e.REG_EXP(foam.nanos.auth.ServiceProvider.ID, /^[a-z0-9]+$/);
          },
          errorString: 'Invalid character(s) in id.'
        }
      ]
    },
    {
      class: 'String',
      name: 'name',
      javaFactory: `
        return getId() + "Service Provider Capability";
      `
    }
  ]
});
{'fraction_non_alphanumeric': 0.15563598759048605, 'fraction_numerical': 0.008273009307135471, 'mean_word_length': 2.3304647160068845, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6187028', 'n_tokens_mistral': 634, 'n_tokens_neox': 614, 'n_words': 123}